com.timgroup.statsd
Interface StatsDClient

All Known Implementing Classes:
NonBlockingStatsDClient, NoOpStatsDClient

public interface StatsDClient

Describes a client connection to a StatsD server, which may be used to post metrics in the form of counters, timers, and gauges.

Three key methods are provided for the submission of data-points for the application under scrutiny:

Author:
Tom Denley

Method Summary
 void count(String aspect, long delta, String... tags)
          Adjusts the specified counter by a given delta.
 void decrement(String aspect, String... tags)
          Convenience method equivalent to decrementCounter(String, String[]).
 void decrementCounter(String aspect, String... tags)
          Decrements the specified counter by one.
 void gauge(String aspect, double value, String... tags)
          Convenience method equivalent to recordGaugeValue(String, double, String[]).
 void gauge(String aspect, long value, String... tags)
          Convenience method equivalent to recordGaugeValue(String, long, String[]).
 void histogram(String aspect, double value, String... tags)
          Convenience method equivalent to recordHistogramValue(String, double, String[]).
 void histogram(String aspect, long value, String... tags)
          Convenience method equivalent to recordHistogramValue(String, long, String[]).
 void increment(String aspect, String... tags)
          Convenience method equivalent to incrementCounter(String, String[]).
 void incrementCounter(String aspect, String... tags)
          Increments the specified counter by one.
 void recordExecutionTime(String aspect, long timeInMs, String... tags)
          Records an execution time in milliseconds for the specified named operation.
 void recordGaugeValue(String aspect, double value, String... tags)
          Records the latest fixed value for the specified named gauge.
 void recordGaugeValue(String aspect, long value, String... tags)
          Records the latest fixed value for the specified named gauge.
 void recordHistogramValue(String aspect, double value, String... tags)
          Records a value for the specified named histogram.
 void recordHistogramValue(String aspect, long value, String... tags)
          Records a value for the specified named histogram.
 void recordServiceCheckRun(ServiceCheck sc)
          Records a run status for the specified named service check.
 void serviceCheck(ServiceCheck sc)
          Convenience method equivalent to recordServiceCheckRun(ServiceCheck sc).
 void stop()
          Cleanly shut down this StatsD client.
 void time(String aspect, long value, String... tags)
          Convenience method equivalent to recordExecutionTime(String, long, String[]).
 

Method Detail

stop

void stop()
Cleanly shut down this StatsD client. This method may throw an exception if the socket cannot be closed.


count

void count(String aspect,
           long delta,
           String... tags)
Adjusts the specified counter by a given delta.

This method is a DataDog extension, and may not work with other servers.

This method is non-blocking and is guaranteed not to throw an exception.

Parameters:
aspect - the name of the counter to adjust
delta - the amount to adjust the counter by
tags - array of tags to be added to the data

incrementCounter

void incrementCounter(String aspect,
                      String... tags)
Increments the specified counter by one.

This method is a DataDog extension, and may not work with other servers.

This method is non-blocking and is guaranteed not to throw an exception.

Parameters:
aspect - the name of the counter to increment
tags - array of tags to be added to the data

increment

void increment(String aspect,
               String... tags)
Convenience method equivalent to incrementCounter(String, String[]).


decrementCounter

void decrementCounter(String aspect,
                      String... tags)
Decrements the specified counter by one.

This method is a DataDog extension, and may not work with other servers.

This method is non-blocking and is guaranteed not to throw an exception.

Parameters:
aspect - the name of the counter to decrement
tags - array of tags to be added to the data

decrement

void decrement(String aspect,
               String... tags)
Convenience method equivalent to decrementCounter(String, String[]).


recordGaugeValue

void recordGaugeValue(String aspect,
                      double value,
                      String... tags)
Records the latest fixed value for the specified named gauge.

This method is a DataDog extension, and may not work with other servers.

This method is non-blocking and is guaranteed not to throw an exception.

Parameters:
aspect - the name of the gauge
value - the new reading of the gauge

gauge

void gauge(String aspect,
           double value,
           String... tags)
Convenience method equivalent to recordGaugeValue(String, double, String[]).


recordGaugeValue

void recordGaugeValue(String aspect,
                      long value,
                      String... tags)
Records the latest fixed value for the specified named gauge.

This method is a DataDog extension, and may not work with other servers.

This method is non-blocking and is guaranteed not to throw an exception.

Parameters:
aspect - the name of the gauge
value - the new reading of the gauge

gauge

void gauge(String aspect,
           long value,
           String... tags)
Convenience method equivalent to recordGaugeValue(String, long, String[]).


recordExecutionTime

void recordExecutionTime(String aspect,
                         long timeInMs,
                         String... tags)
Records an execution time in milliseconds for the specified named operation.

This method is a DataDog extension, and may not work with other servers.

This method is non-blocking and is guaranteed not to throw an exception.

Parameters:
aspect - the name of the timed operation
timeInMs - the time in milliseconds
tags - array of tags to be added to the data

time

void time(String aspect,
          long value,
          String... tags)
Convenience method equivalent to recordExecutionTime(String, long, String[]).


recordHistogramValue

void recordHistogramValue(String aspect,
                          double value,
                          String... tags)
Records a value for the specified named histogram.

This method is a DataDog extension, and may not work with other servers.

This method is non-blocking and is guaranteed not to throw an exception.

Parameters:
aspect - the name of the histogram
value - the value to be incorporated in the histogram
tags - array of tags to be added to the data

histogram

void histogram(String aspect,
               double value,
               String... tags)
Convenience method equivalent to recordHistogramValue(String, double, String[]).


recordHistogramValue

void recordHistogramValue(String aspect,
                          long value,
                          String... tags)
Records a value for the specified named histogram.

This method is a DataDog extension, and may not work with other servers.

This method is non-blocking and is guaranteed not to throw an exception.

Parameters:
aspect - the name of the histogram
value - the value to be incorporated in the histogram
tags - array of tags to be added to the data

histogram

void histogram(String aspect,
               long value,
               String... tags)
Convenience method equivalent to recordHistogramValue(String, long, String[]).


recordServiceCheckRun

void recordServiceCheckRun(ServiceCheck sc)
Records a run status for the specified named service check.

This method is a DataDog extension, and may not work with other servers.

This method is non-blocking and is guaranteed not to throw an exception.

Parameters:
sc - the service check object

serviceCheck

void serviceCheck(ServiceCheck sc)
Convenience method equivalent to recordServiceCheckRun(ServiceCheck sc).



Copyright © 2015. All rights reserved.