pub struct TriggerConfig {
pub trigger_mode: Option<i32>,
pub use_clone_snapshot_if_available: Option<bool>,
pub triggers: Vec<Trigger>,
pub trigger_timeout_ms: Option<u32>,
}
Expand description
Triggers allow producers to start or stop the tracing session when an event occurs.
For example if we are tracing probabilistically, most traces will be uninteresting. Triggers allow us to keep only the interesting ones such as those traces during which the device temperature reached a certain threshold. In this case the producer can activate a trigger to keep (STOP_TRACING) the trace, otherwise it can also begin a trace (START_TRACING) because it knows something is about to happen.
Fields§
§trigger_mode: Option<i32>
§use_clone_snapshot_if_available: Option<bool>
This flag is really a workaround for b/274931668. This is needed only when deploying configs to different versions of the tracing service. When this is set to true this has the same effect of setting trigger_mode to CLONE_SNAPSHOT on newer versions of the service. This boolean has been introduced to allow to have configs that use CLONE_SNAPSHOT on newer versions of Android and fall back to STOP_TRACING on older versions where CLONE_SNAPSHOT did not exist. When using this flag, trigger_mode must be set to STOP_TRACING.
triggers: Vec<Trigger>
A list of triggers which are related to this configuration. If ANY trigger is seen then an action will be performed based on |trigger_mode|.
trigger_timeout_ms: Option<u32>
Required and must be positive if a TriggerConfig is specified. This is how long this TraceConfig should wait for a trigger to arrive. After this period of time if no trigger is seen the TracingSession will be cleaned up.
Implementations§
Source§impl TriggerConfig
impl TriggerConfig
Sourcepub fn trigger_mode(&self) -> TriggerMode
pub fn trigger_mode(&self) -> TriggerMode
Returns the enum value of trigger_mode
, or the default if the field is unset or set to an invalid enum value.
Sourcepub fn set_trigger_mode(&mut self, value: TriggerMode)
pub fn set_trigger_mode(&mut self, value: TriggerMode)
Sets trigger_mode
to the provided enum value.
Sourcepub fn trigger_timeout_ms(&self) -> u32
pub fn trigger_timeout_ms(&self) -> u32
Returns the value of trigger_timeout_ms
, or the default value if trigger_timeout_ms
is unset.
Sourcepub fn use_clone_snapshot_if_available(&self) -> bool
pub fn use_clone_snapshot_if_available(&self) -> bool
Returns the value of use_clone_snapshot_if_available
, or the default value if use_clone_snapshot_if_available
is unset.
Trait Implementations§
Source§impl Clone for TriggerConfig
impl Clone for TriggerConfig
Source§fn clone(&self) -> TriggerConfig
fn clone(&self) -> TriggerConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for TriggerConfig
impl Debug for TriggerConfig
Source§impl Default for TriggerConfig
impl Default for TriggerConfig
Source§impl Message for TriggerConfig
impl Message for TriggerConfig
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
Source§fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
Source§fn decode<B>(buf: B) -> Result<Self, DecodeError>
fn decode<B>(buf: B) -> Result<Self, DecodeError>
Source§fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
Source§fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
self
. Read moreSource§fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
self
.