pub trait Compat {
// Required methods
fn time_duration_with_tags<'a>(
&'a self,
key: &'a str,
val: Duration,
) -> MetricBuilder<'_, '_, Timer>;
fn gauge_f64_with_tags<'a>(
&'a self,
key: &'a str,
val: f64,
) -> MetricBuilder<'_, '_, Gauge>;
fn mark_with_tags<'a>(
&'a self,
key: &'a str,
) -> MetricBuilder<'_, '_, Meter>;
fn histogram_duration_with_tags<'a>(
&'a self,
key: &'a str,
val: Duration,
) -> MetricBuilder<'_, '_, Histogram>;
// Provided methods
fn time_duration(&self, key: &str, val: Duration) -> MetricResult<Timer> { ... }
fn gauge_f64(&self, key: &str, val: f64) -> MetricResult<Gauge> { ... }
fn mark(&self, key: &str) -> MetricResult<Meter> { ... }
fn histogram_duration(
&self,
key: &str,
val: Duration,
) -> MetricResult<Histogram> { ... }
}
Expand description
Backwards compatibility shim for removed and deprecated methods.
To allow people time to migrate, the removed methods are implemented here. These methods should be considered deprecated and not viable to use long-term (this trait will be removed in a future release).
For more information about how to migrate away from the methods in this
trait, see the MIGRATION.md
file in the root of the repository.
Required Methodsยง
๐Deprecated: Use
client.time_with_tags(key, val)
๐Deprecated: Use
client.gauge_with_tags(key, val)
๐Deprecated: Use
client.meter_with_tags(key, 1)
๐Deprecated: Use
client.histogram_with_tags(key, val)
Provided Methodsยง
fn time_duration(&self, key: &str, val: Duration) -> MetricResult<Timer>
๐Deprecated: Use
client.time(key, val)
fn gauge_f64(&self, key: &str, val: f64) -> MetricResult<Gauge>
๐Deprecated: Use
client.gauge(key, val)
fn mark(&self, key: &str) -> MetricResult<Meter>
๐Deprecated: Use
client.meter(key, 1)
fn histogram_duration( &self, key: &str, val: Duration, ) -> MetricResult<Histogram>
๐Deprecated: Use
client.histogram(key, val)