pub struct ReplayContext {
pub mcap_path: PathBuf,
pub deterministic: bool,
/* private fields */
}Expand description
Context for replay-based tests.
Fields§
§mcap_path: PathBuf§deterministic: boolImplementations§
Source§impl ReplayContext
impl ReplayContext
pub fn new(mcap_path: impl Into<PathBuf>) -> Self
Sourcepub fn record_frame_latency(&self, latency: Duration)
pub fn record_frame_latency(&self, latency: Duration)
Record one frame’s inference latency (e.g. InferenceStats::latency from
clankers_ml) so latency can report an aggregate over
the whole replay.
Sourcepub fn record_frame_inference(
&self,
latency: Duration,
copies: usize,
allocations: usize,
bytes_copied: usize,
)
pub fn record_frame_inference( &self, latency: Duration, copies: usize, allocations: usize, bytes_copied: usize, )
Record per-frame inference accounting (e.g. fields from
clankers_ml::InferenceStats) alongside latency.
pub async fn run_replay<F, Fut>( &self, handler: F, ) -> RobotResult<ReplayTestResult>
Sourcepub fn latency(&self) -> LatencyStats
pub fn latency(&self) -> LatencyStats
The aggregate of every latency passed to
record_frame_latency during the replay.
For end-to-end replay timing (per message, measured by the replay engine),
use result.replay.latency from run_replay instead.
Sourcepub fn inference_stats(&self) -> AggregatedInferenceStats
pub fn inference_stats(&self) -> AggregatedInferenceStats
Aggregated copy/allocation accounting from
record_frame_inference.
Auto Trait Implementations§
impl !Freeze for ReplayContext
impl RefUnwindSafe for ReplayContext
impl Send for ReplayContext
impl Sync for ReplayContext
impl Unpin for ReplayContext
impl UnsafeUnpin for ReplayContext
impl UnwindSafe for ReplayContext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more