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

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.

Scope

An method dispatching command enum to manipulate metric scopes. Replaces a potential Writer trait that would have methods write and flush. Using a command pattern allows buffering, async queuing and inline definition of writers.

Constants

FULL_SAMPLING_RATE

Do not sample, use all data.

Traits

AsSink

Expose the Sink nature of a multi-faceted struct.

Sink

Main trait of the metrics backend API. Defines a component that can be used when setting up a metrics backend stack. Intermediate sinks transform how metrics are defined and written: - Sampling - Dual - Cache Terminal sinks store or propagate metric values to other systems. - Statsd - Log - Aggregate Print metrics to Generic.

Type Definitions

Rate

Base type for sampling rate. - 1.0 records everything - 0.5 records one of two values - 0.0 records nothing The actual distribution (random, fixed-cycled, etc) depends on selected sampling method.

ScopeFn

Scope creation function. Returns a callback function to send commands to the metric scope. 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.

Value

Base type for recorded metric values.