Trait goodmetrics::metrics_factory::RecordingScope
source · pub trait RecordingScope<'a, TMetricsRef: 'a>: ReturnTarget<'a, TMetricsRef>where
Self: Sized,{
fn record_scope(
&'a self,
scope_name: impl Into<Name>
) -> ReturningRef<'a, TMetricsRef, Self>;
fn record_scope_with_behavior(
&'a self,
scope_name: impl Into<Name>,
behavior: MetricsBehavior
) -> ReturningRef<'a, TMetricsRef, Self>;
fn emit(&self, metrics: TMetricsRef);
unsafe fn create_new_raw_metrics(
&'a self,
metrics_name: impl Into<Name>
) -> TMetricsRef;
}
Required Methods§
fn record_scope(
&'a self,
scope_name: impl Into<Name>
) -> ReturningRef<'a, TMetricsRef, Self>
fn record_scope_with_behavior(
&'a self,
scope_name: impl Into<Name>,
behavior: MetricsBehavior
) -> ReturningRef<'a, TMetricsRef, Self>
fn emit(&self, metrics: TMetricsRef)
sourceunsafe fn create_new_raw_metrics(
&'a self,
metrics_name: impl Into<Name>
) -> TMetricsRef
unsafe fn create_new_raw_metrics(
&'a self,
metrics_name: impl Into<Name>
) -> TMetricsRef
Safety
You should strongly consider using record_scope() instead. You must emit() the returned instance through this MetricsFactory instance or else you may leak memory, depending on the semantics of your allocator.