pub struct PlotlyRecorderBuilder {}
Implementations§
Source§impl PlotlyRecorderBuilder
impl PlotlyRecorderBuilder
Sourcepub fn new() -> Self
pub fn new() -> Self
Examples found in repository?
examples/basic.rs (line 6)
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}
Sourcepub fn install(
self,
) -> Result<PlotlyRecorderHandle, SetRecorderError<PlotlyRecorder>>
pub fn install( self, ) -> Result<PlotlyRecorderHandle, SetRecorderError<PlotlyRecorder>>
Install the recorder globally.
Examples found in repository?
examples/basic.rs (line 6)
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}
Sourcepub fn build(&self) -> PlotlyRecorder
pub fn build(&self) -> PlotlyRecorder
No intended for normal use, only for manually installing the recorder.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PlotlyRecorderBuilder
impl RefUnwindSafe for PlotlyRecorderBuilder
impl Send for PlotlyRecorderBuilder
impl Sync for PlotlyRecorderBuilder
impl Unpin for PlotlyRecorderBuilder
impl UnwindSafe for PlotlyRecorderBuilder
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