[go: up one dir, main page]

cadence 0.1.0

An extensible Statsd client for Rust
Documentation

Cadence

Build Status

An extensible Statsd client for Rust!

Features

  • Support for emitting counters, timers, gauges, and meters to Statsd over UDP.
  • Support for alternate backends via the MetricSink trait.
  • A simple yet flexible API for sending metrics.

Install

To make use of Cadence in your project, add it as a dependency.

[dependencies]
cadence = "x.y.z"

Usage

Typical usage of Cadence is shown below:

// Import the client
use cadence::{
    StatsdClient,
    UdpMetricSink
};

// Create client that will write to the given host over UDP.
//
// Note that you'll probably want to actually handle any errors creating the client
// when you use it for real in your application. We're just using .unwrap() here
// since this is an example!
let host = ("metrics.example.com", 8125);
let client = StatsdClient::<UdpMetricSink>::from_host("my.metrics", host).unwrap();

// Emit metrics!
client.incr("some.counter");
client.time("some.methodCall", 42);
client.meter("some.value", 5);

Documentation

Documentation is available at http://tshlabs.github.io/cadence/

Source

The source code is available on GitHub at https://github.com/tshlabs/cadence

Changes

Release notes for Cadence can be found in the CHANGES.md file.