Available on crate feature
component
only.Expand description
Crate-specific metrics functionality.
This module re-exports the contents of the metrics
crate. This is
effectively a way to monkey-patch the functions in this module into the
metrics
crate, at least from the point of view of the other code in this
crate.
Code in this crate that wants to use metrics should use crate::metrics;
,
so that this module shadows the metrics
crate.
This trick is probably good to avoid in general, because it could be confusing, but in this limited case, it seems like a clean option.
Modules§
- atomics
- Atomic types used for metrics.
Macros§
- counter
- Registers a counter.
- describe_
counter - Describes a counter.
- describe_
gauge - Describes a gauge.
- describe_
histogram - Describes a histogram.
- gauge
- Registers a gauge.
- histogram
- Registers a histogram.
Structs§
- Counter
- A counter.
- Gauge
- A gauge.
- Histogram
- A histogram.
- Key
- A metric identifier.
- KeyHasher
- Key-specific hashing algorithm.
- KeyName
- Name component of a key.
- Label
- Metadata for a metric key in the form of a key/value pair.
- Level
- Verbosity of a metric.
- Local
Recorder Guard - Guard for setting a local recorder.
- Metadata
- Metadata describing a metric.
- Noop
Recorder - A no-op recorder.
- SetRecorder
Error - Error returned when trying to install a global recorder when another has already been installed.
Enums§
- Gauge
Value - Value of a gauge operation.
- Unit
- Units for a given metric.
Constants§
- DEX_
ARB_ DURATION - DEX_
BATCH_ DURATION - DEX_
PATH_ SEARCH_ DURATION - DEX_
PATH_ SEARCH_ RELAX_ PATH_ DURATION - DEX_
ROUTE_ FILL_ DURATION - DEX_
RPC_ SIMULATE_ TRADE_ DURATION
Traits§
- Counter
Fn - A counter handler.
- GaugeFn
- A gauge handler.
- Histogram
Fn - A histogram handler.
- IntoF64
- An object which can be converted into a
f64
representation. - Into
Labels - A value that can be converted to a vector of
Label
s. - Prometheus
Builder Ext - An extension trait providing DEX-related interfaces for [
PrometheusBuilder
]. - Recorder
- A trait for registering and recording metrics.
Functions§
- register_
metrics - Registers all metrics used by this crate.
- set_
default_ local_ recorder - Sets the recorder as the default for the current thread for the duration of the lifetime of the returned
LocalRecorderGuard
. - set_
global_ recorder - Sets the global recorder.
- with_
local_ recorder - Runs the closure with the given recorder set as the global recorder for the duration.
- with_
recorder - Runs the closure with a reference to the current recorder for this scope.
Type Aliases§
- Shared
String - An allocation-optimized string.