#[non_exhaustive]pub struct Profile {
pub name: String,
pub profile_type: ProfileType,
pub deployment: Option<Deployment>,
pub duration: Option<Duration>,
pub profile_bytes: Bytes,
pub labels: HashMap<String, String>,
pub start_time: Option<Timestamp>,
/* private fields */
}Expand description
Profile resource.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringOutput only. Opaque, server-assigned, unique ID for this profile.
profile_type: ProfileTypeType of profile. For offline mode, this must be specified when creating the profile. For online mode it is assigned and returned by the server.
deployment: Option<Deployment>Deployment this profile corresponds to.
duration: Option<Duration>Duration of the profiling session. Input (for the offline mode) or output (for the online mode). The field represents requested profiling duration. It may slightly differ from the effective profiling duration, which is recorded in the profile data, in case the profiling can’t be stopped immediately (e.g. in case stopping the profiling is handled asynchronously).
profile_bytes: BytesInput only. Profile bytes, as a gzip compressed serialized proto, the format is https://github.com/google/pprof/blob/master/proto/profile.proto.
labels: HashMap<String, String>Input only. Labels associated to this specific profile. These labels will get merged with the deployment labels for the final data set. See documentation on deployment labels for validation rules and limits.
start_time: Option<Timestamp>Output only. Start time for the profile. This output is only present in response from the ListProfiles method.
Implementations§
Source§impl Profile
impl Profile
pub fn new() -> Self
Sourcepub fn set_profile_type<T: Into<ProfileType>>(self, v: T) -> Self
pub fn set_profile_type<T: Into<ProfileType>>(self, v: T) -> Self
Sets the value of profile_type.
§Example
use google_cloud_profiler_v2::model::ProfileType;
let x0 = Profile::new().set_profile_type(ProfileType::Cpu);
let x1 = Profile::new().set_profile_type(ProfileType::Wall);
let x2 = Profile::new().set_profile_type(ProfileType::Heap);Sourcepub fn set_deployment<T>(self, v: T) -> Selfwhere
T: Into<Deployment>,
pub fn set_deployment<T>(self, v: T) -> Selfwhere
T: Into<Deployment>,
Sets the value of deployment.
§Example
use google_cloud_profiler_v2::model::Deployment;
let x = Profile::new().set_deployment(Deployment::default()/* use setters */);Sourcepub fn set_or_clear_deployment<T>(self, v: Option<T>) -> Selfwhere
T: Into<Deployment>,
pub fn set_or_clear_deployment<T>(self, v: Option<T>) -> Selfwhere
T: Into<Deployment>,
Sets or clears the value of deployment.
§Example
use google_cloud_profiler_v2::model::Deployment;
let x = Profile::new().set_or_clear_deployment(Some(Deployment::default()/* use setters */));
let x = Profile::new().set_or_clear_deployment(None::<Deployment>);Sourcepub fn set_duration<T>(self, v: T) -> Self
pub fn set_duration<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_duration<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_duration<T>(self, v: Option<T>) -> Self
Sourcepub fn set_profile_bytes<T: Into<Bytes>>(self, v: T) -> Self
pub fn set_profile_bytes<T: Into<Bytes>>(self, v: T) -> Self
Sets the value of profile_bytes.
§Example
let x = Profile::new().set_profile_bytes(bytes::Bytes::from_static(b"example"));Sourcepub fn set_labels<T, K, V>(self, v: T) -> Self
pub fn set_labels<T, K, V>(self, v: T) -> Self
Sourcepub fn set_start_time<T>(self, v: T) -> Self
pub fn set_start_time<T>(self, v: T) -> Self
Sets the value of start_time.
§Example
use wkt::Timestamp;
let x = Profile::new().set_start_time(Timestamp::default()/* use setters */);Sourcepub fn set_or_clear_start_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_start_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of start_time.
§Example
use wkt::Timestamp;
let x = Profile::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
let x = Profile::new().set_or_clear_start_time(None::<Timestamp>);