pub struct PlotlyRecorderHandle { /* private fields */ }
Implementations§
Source§impl PlotlyRecorderHandle
impl PlotlyRecorderHandle
Sourcepub async fn plot(self, groups: &[PatternGroup])
pub async fn plot(self, groups: &[PatternGroup])
Plot the metrics
Consumes the handle and metrics data for a one-shot plotting of the metrics. Takes a slice
of PatternGroup
s which will each be opened in a new browser window.
Examples found in repository?
examples/basic.rs (lines 22-24)
5async fn main() {
6 let handle = PlotlyRecorderBuilder::new().install().unwrap();
7
8 let h = tokio::spawn(async {
9 for _ in 0..200 {
10 counter!("something_success").increment(1);
11 counter!("something_error").increment(1);
12
13 counter!("foo_asdf_success").increment(2);
14 counter!("foo_asdf_error").increment(2);
15 tokio::time::sleep(std::time::Duration::from_millis(10)).await;
16 }
17 });
18
19 h.await;
20
21 handle
22 .plot(&[PatternGroup::new()
23 .pattern(r"(?<transaction>.*)_success", PlotKind::Rate)
24 .pattern(r"(?<transaction>.*)_error", PlotKind::Rate)])
25 .await;
26}
Auto Trait Implementations§
impl Freeze for PlotlyRecorderHandle
impl !RefUnwindSafe for PlotlyRecorderHandle
impl Send for PlotlyRecorderHandle
impl Sync for PlotlyRecorderHandle
impl Unpin for PlotlyRecorderHandle
impl !UnwindSafe for PlotlyRecorderHandle
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