Module dipstick::core
[−]
[src]
Dipstick metrics core types and traits.
This is mostly centered around the backend.
Application-facing types are in the app
module.
Structs
Chain |
A pair of functions composing a twin "chain of command". This is the building block for the metrics backend. |
ControlScopeFn |
Returns a callback function to send commands to the metric scope. Writes can be performed by passing Some((&Metric, Value)) Flushes can be performed by passing None Used to write values to the scope or flush the scope buffer (if applicable). Simple applications may use only one scope. Complex applications may define a new scope fo each operation or request. Scopes can be moved acrossed threads (Send) but are not required to be thread-safe (Sync). Some implementations may be 'Sync', otherwise queue()ing or threadlocal() can be used. |
ScopeCounter |
A counter that sends values to the metrics backend |
ScopeGauge |
A gauge that sends values to the metrics backend |
ScopeMarker |
A monotonic counter metric. Since value is only ever increased by one, no value parameter is provided, preventing programming errors. |
ScopeTimer |
A timer that sends values to the metrics backend Timers can record time intervals in multiple ways : |
TimeHandle |
A handle to the start time of a counter. Wrapped so it may be changed safely later. |
Enums
Kind |
Used to differentiate between metric kinds in the backend. |
ScopeCmd |
An method dispatching command enum to manipulate metric scopes.
Replaces a potential |
Constants
FULL_SAMPLING_RATE |
Do not sample, use all data. |
Traits
ToPrimitive |
A generic trait for converting a value to a number. |
Functions
imprecise_clock_micros |
takes 25ns but fails to advance time on occasion |
slow_clock_micros |
takes 250ns but works every time |
Type Definitions
DefineMetricFn |
Dynamic metric definition function.
Metrics can be defined from any thread, concurrently (Fn is Sync).
The resulting metrics themselves can be also be safely shared across threads ( |
OpenScopeFn |
A function trait that opens a new metric capture scope. |
Rate |
Base type for sampling rate. |
Value |
Base type for recorded metric values. |