pub struct LongTermTimingProperties { /* private fields */ }
Expand description
Timing properties that persist through a message chain.
See OutgoingShortTermTimingProperties for more explanation on timings.
There are two kinds of properties: regular an cumulative. Regular properties just get proxied without change to the next message in the chain. Cumulative properties sum corresponding values from OutgoingShortTermTimingProperties.
If you use methods like to_response, to_request, to_event and similar then you shouldn’t think about long term timings since they already take care of all these things.
Implementations§
Source§impl LongTermTimingProperties
impl LongTermTimingProperties
Sourcepub fn update_cumulative_timings(
self,
short_timing: &OutgoingShortTermTimingProperties,
) -> Self
pub fn update_cumulative_timings( self, short_timing: &OutgoingShortTermTimingProperties, ) -> Self
Updates cumulative values with the given OutgoingShortTermTimingProperties values.
Prefer using to_response and similar methods for building responses. If you by any chance can’t use them but still want to pass LongTermTimingProperties manually then this is the method to call to keep timings consistent.
§Arguments
short_timing
– a reference to OutgoingShortTermTimingProperties object with values to increase long term timings with.
§Example
let short_term_timing = OutgoingShortTermTimingProperties::until_now(start_timestamp);
let long_term_timing = response
.properties()
.long_term_timing()
.clone()
.update_cumulative_timings(&short_term_timing);
let props = OutgoingResponseProperties::new(
response.properties().status(),
request.correlation_data(),
long_term_timing,
short_term_timing,
response.properties().tracking().clone(),
);
let message = OutgoingResponse::unicast(
response.payload().to_owned(),
props,
request.properties(),
"v1"
);
Trait Implementations§
Source§impl Clone for LongTermTimingProperties
impl Clone for LongTermTimingProperties
Source§fn clone(&self) -> LongTermTimingProperties
fn clone(&self) -> LongTermTimingProperties
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read more