pub struct Trigger {
pub name: Option<String>,
pub producer_name_regex: Option<String>,
pub stop_delay_ms: Option<u32>,
pub max_per_24_h: Option<u32>,
pub skip_probability: Option<f64>,
}
Fields§
§name: Option<String>
The producer must specify this name to activate the trigger.
producer_name_regex: Option<String>
An std::regex that will match the producer that can activate this trigger. This is optional. If unset any producers can activate this trigger.
stop_delay_ms: Option<u32>
After a trigger is received either in START_TRACING or STOP_TRACING mode then the trace will end |stop_delay_ms| after triggering. In CLONE_SNAPSHOT mode, this is the delay between the trigger and the snapshot. If |prefer_suspend_clock_for_duration| is set, the duration will be based on wall-clock, counting also time in suspend.
max_per_24_h: Option<u32>
Limits the number of traces this trigger can start/stop in a rolling 24 hour window. If this field is unset or zero, no limit is applied and activiation of this trigger always starts/stops the trace.
skip_probability: Option<f64>
A value between 0 and 1 which encodes the probability of skipping a trigger with this name. This is useful for reducing the probability of high-frequency triggers from dominating trace finaization. If this field is unset or zero, the trigger will never be skipped. If this field is greater than or equal to 1, this trigger will always be skipped i.e. it will be as if this trigger was never included in the first place. This probability check is applied before any other limits. For example, if |max_per_24_h| is also set, first we will check if the probability bar is met and only then will we check the |max_per_24_h| limit.
Implementations§
Source§impl Trigger
impl Trigger
Sourcepub fn producer_name_regex(&self) -> &str
pub fn producer_name_regex(&self) -> &str
Returns the value of producer_name_regex
, or the default value if producer_name_regex
is unset.
Sourcepub fn stop_delay_ms(&self) -> u32
pub fn stop_delay_ms(&self) -> u32
Returns the value of stop_delay_ms
, or the default value if stop_delay_ms
is unset.
Sourcepub fn max_per_24_h(&self) -> u32
pub fn max_per_24_h(&self) -> u32
Returns the value of max_per_24_h
, or the default value if max_per_24_h
is unset.
Sourcepub fn skip_probability(&self) -> f64
pub fn skip_probability(&self) -> f64
Returns the value of skip_probability
, or the default value if skip_probability
is unset.
Trait Implementations§
Source§impl Message for Trigger
impl Message for Trigger
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
.