Struct statsd::client::Pipeline [] [src]

pub struct Pipeline { /* fields omitted */ }

Methods

impl Pipeline
[src]

[src]

[src]

Set max UDP packet size

use statsd::client::Pipeline;

let mut pipe = Pipeline::new();
pipe.set_max_udp_size(128);

[src]

Increment a metric by 1

use statsd::client::Pipeline;

let mut pipe = Pipeline::new();
// Increment a given metric by 1.
pipe.incr("metric.completed");

This modifies a counter with an effective sampling rate of 1.0.

[src]

Decrement a metric by -1

use statsd::client::Pipeline;

let mut pipe = Pipeline::new();
// Decrement a given metric by 1
pipe.decr("metric.completed");

This modifies a counter with an effective sampling rate of 1.0.

[src]

Modify a counter by value.

Will increment or decrement a counter by value with a sampling rate of 1.0.

use statsd::client::Pipeline;

let mut pipe = Pipeline::new();
// Increment by 12
pipe.count("metric.completed", 12.0);

[src]

Modify a counter by value only x% of the time.

Will increment or decrement a counter by value with a custom sampling rate.

use statsd::client::Pipeline;

let mut pipe = Pipeline::new();
// Increment by 4 50% of the time.
pipe.sampled_count("metric.completed", 4.0, 0.5);

[src]

Set a gauge value.

use statsd::client::Pipeline;

let mut pipe = Pipeline::new();
// set a gauge to 9001
pipe.gauge("power_level.observed", 9001.0);

[src]

Send a timer value.

The value is expected to be in ms.

use statsd::client::Pipeline;

let mut pipe = Pipeline::new();
// pass a duration value
pipe.timer("response.duration", 10.123);

[src]

Time a block of code.

The passed closure will be timed and executed. The block's duration will be sent as a metric.

use statsd::client::Pipeline;

let mut pipe = Pipeline::new();
// pass a duration value
pipe.time("response.duration", || {
  // Your code here.
});

[src]

Send data along the UDP socket.