Giter Site home page Giter Site logo

cadence's Introduction

Cadence

build status docs.rs crates.io Rust 1.36+

Documentation

An extensible Statsd client for Rust!

Cadence is a fast and flexible way to emit Statsd metrics from your application.

Features

  • Support for emitting counters, timers, histograms, distributions, gauges, meters, and sets to Statsd over UDP (or optionally Unix sockets).
  • Support for alternate backends via the MetricSink trait.
  • Support for Datadog style metrics tags.
  • Macros to simplify common calls to emit metrics
  • A simple yet flexible API for sending metrics.

Usage

An example of how to use Cadence for maximum performance is given below. For many more examples and advanced use cases, see the cadence crate or the documentation.

use std::net::UdpSocket;
use cadence::prelude::*;
use cadence::{StatsdClient, QueuingMetricSink, BufferedUdpMetricSink, DEFAULT_PORT};

let socket = UdpSocket::bind("0.0.0.0:0").unwrap();
socket.set_nonblocking(true).unwrap();

let host = ("metrics.example.com", DEFAULT_PORT);
let udp_sink = BufferedUdpMetricSink::from(host, socket).unwrap();
let queuing_sink = QueuingMetricSink::from(udp_sink);
let client = StatsdClient::from_sink("my.prefix", queuing_sink);

client.count("my.counter.thing", 29);
client.time("my.service.call", 214);
client.incr("some.event");

Project layout

The cadence crate contains the Statsd client and primary API of Cadence. The cadence-macros crate contains optional macros that can simplify use of the Cadence API.

Documentation

The documentation is available at https://docs.rs/cadence/ or https://docs.rs/cadence-macros/

Source

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

Changes

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

Development

Cadence uses Cargo for performing various development tasks.

To build Cadence:

$ cargo build

To run tests:

$ cargo test

or:

$ cargo test -- --ignored

To run benchmarks:

$ cargo bench

To build documentation:

$ cargo doc

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you shall be dual licensed as above, without any additional terms or conditions.

Language Support

Cadence (latest master) supports building with a range of 1.36+ versions.

Guaranteed to Build

The latest version of Cadence is tested against and will always build correctly with

  • The current stable version.
  • The previous two stable versions, stable - 1 and stable - 2.

Best Effort Build

The latest version of Cadence is tested against and will usually build correctly with

  • The next two oldest stable versions, stable - 3 and stable - 4.

Support for these versions may be dropped for a release in order to take advantage of a feature available in newer versions of Rust.

Known to Work

  • Stable versions as far back as 1.36 are known to work with Cadence 0.21.0. Building with this version (and any versions older than stable - 4) is not supported and may break at any time.

  • Stable versions as far back as 1.34 are known to work with Cadence 0.20.0. Building with this version (and any versions older than stable - 4) is not supported and may break at any time.

  • Stable versions as far back as 1.32 are known to work with Cadence 0.19.0. Building with this version (and any versions older than stable - 4) is not supported and may break at any time.

  • Stable versions as far back as 1.31 are known to work with Cadence 0.18.0. Building with this version (and any versions older than stable - 4) is not supported and may break at any time.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.