Expand description
Advanced extension points for the Cadence library
Most users of Cadence shouldn’t need to make use of this module or the included traits and types. However, users that need to extend the library in unforeseen ways may find them useful.
The MetricBackend
trait, for example, can be used to implement a
client that sends a new non-standard type of metric using the same
backend that Cadence would use (via the .send_metric()
method).
The various To*Value
traits are used as markers for types that are
valid for each type of metric. They also contain conversion logic for
the types in some cases (such as in the case of Duration
objects).
These can be used to allow your own custom types to be converted to
metric values that Cadence understands.
In summary, most users don’t need to worry about these types but they are available for advanced use cases and subject to the same guarantees as the rest of the API (semantic versioning, etc.).
Enums
- Holder for primitive metric values that knows how to display itself
Traits
- Typically internal client methods for sending metrics and handling errors.
- Conversion trait for valid values for counters
- Conversion trait for valid values for distributions
- Conversion trait for valid values for gauges
- Conversion trait for valid values for histograms
- Conversion trait for valid values for meters
- Conversion trait for valid values for sets
- Conversion trait for valid values for timers