com.timgroup.statsd
Class NoOpStatsDClient

java.lang.Object
  extended by com.timgroup.statsd.NoOpStatsDClient
All Implemented Interfaces:
StatsDClient

public final class NoOpStatsDClient
extends Object
implements StatsDClient

A No-Op StatsDClient, which can be substituted in when metrics are not required.

Author:
Tom Denley

Constructor Summary
NoOpStatsDClient()
           
 
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 StatsDClient.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 StatsDClient.recordGaugeValue(String, double, String[]).
 void gauge(String aspect, long value, String... tags)
          Convenience method equivalent to StatsDClient.recordGaugeValue(String, long, String[]).
 void histogram(String aspect, double value, String... tags)
          Convenience method equivalent to StatsDClient.recordHistogramValue(String, double, String[]).
 void histogram(String aspect, long value, String... tags)
          Convenience method equivalent to StatsDClient.recordHistogramValue(String, long, String[]).
 void increment(String aspect, String... tags)
          Convenience method equivalent to StatsDClient.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 StatsDClient.recordServiceCheckRun(ServiceCheck sc).
 void stop()
          Cleanly shut down this StatsD client.
 void time(String aspect, long value, String... tags)
          Convenience method equivalent to StatsDClient.recordExecutionTime(String, long, String[]).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NoOpStatsDClient

public NoOpStatsDClient()
Method Detail

stop

public void stop()
Description copied from interface: StatsDClient
Cleanly shut down this StatsD client. This method may throw an exception if the socket cannot be closed.

Specified by:
stop in interface StatsDClient

count

public void count(String aspect,
                  long delta,
                  String... tags)
Description copied from interface: StatsDClient
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.

Specified by:
count in interface StatsDClient
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

public void incrementCounter(String aspect,
                             String... tags)
Description copied from interface: StatsDClient
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.

Specified by:
incrementCounter in interface StatsDClient
Parameters:
aspect - the name of the counter to increment
tags - array of tags to be added to the data

increment

public void increment(String aspect,
                      String... tags)
Description copied from interface: StatsDClient
Convenience method equivalent to StatsDClient.incrementCounter(String, String[]).

Specified by:
increment in interface StatsDClient

decrementCounter

public void decrementCounter(String aspect,
                             String... tags)
Description copied from interface: StatsDClient
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.

Specified by:
decrementCounter in interface StatsDClient
Parameters:
aspect - the name of the counter to decrement
tags - array of tags to be added to the data

decrement

public void decrement(String aspect,
                      String... tags)
Description copied from interface: StatsDClient
Convenience method equivalent to StatsDClient.decrementCounter(String, String[]).

Specified by:
decrement in interface StatsDClient

recordGaugeValue

public void recordGaugeValue(String aspect,
                             double value,
                             String... tags)
Description copied from interface: StatsDClient
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.

Specified by:
recordGaugeValue in interface StatsDClient
Parameters:
aspect - the name of the gauge
value - the new reading of the gauge

gauge

public void gauge(String aspect,
                  double value,
                  String... tags)
Description copied from interface: StatsDClient
Convenience method equivalent to StatsDClient.recordGaugeValue(String, double, String[]).

Specified by:
gauge in interface StatsDClient

recordGaugeValue

public void recordGaugeValue(String aspect,
                             long value,
                             String... tags)
Description copied from interface: StatsDClient
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.

Specified by:
recordGaugeValue in interface StatsDClient
Parameters:
aspect - the name of the gauge
value - the new reading of the gauge

gauge

public void gauge(String aspect,
                  long value,
                  String... tags)
Description copied from interface: StatsDClient
Convenience method equivalent to StatsDClient.recordGaugeValue(String, long, String[]).

Specified by:
gauge in interface StatsDClient

recordExecutionTime

public void recordExecutionTime(String aspect,
                                long timeInMs,
                                String... tags)
Description copied from interface: StatsDClient
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.

Specified by:
recordExecutionTime in interface StatsDClient
Parameters:
aspect - the name of the timed operation
timeInMs - the time in milliseconds
tags - array of tags to be added to the data

time

public void time(String aspect,
                 long value,
                 String... tags)
Description copied from interface: StatsDClient
Convenience method equivalent to StatsDClient.recordExecutionTime(String, long, String[]).

Specified by:
time in interface StatsDClient

recordHistogramValue

public void recordHistogramValue(String aspect,
                                 double value,
                                 String... tags)
Description copied from interface: StatsDClient
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.

Specified by:
recordHistogramValue in interface StatsDClient
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

public void histogram(String aspect,
                      double value,
                      String... tags)
Description copied from interface: StatsDClient
Convenience method equivalent to StatsDClient.recordHistogramValue(String, double, String[]).

Specified by:
histogram in interface StatsDClient

recordHistogramValue

public void recordHistogramValue(String aspect,
                                 long value,
                                 String... tags)
Description copied from interface: StatsDClient
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.

Specified by:
recordHistogramValue in interface StatsDClient
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

public void histogram(String aspect,
                      long value,
                      String... tags)
Description copied from interface: StatsDClient
Convenience method equivalent to StatsDClient.recordHistogramValue(String, long, String[]).

Specified by:
histogram in interface StatsDClient

recordServiceCheckRun

public void recordServiceCheckRun(ServiceCheck sc)
Description copied from interface: StatsDClient
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.

Specified by:
recordServiceCheckRun in interface StatsDClient
Parameters:
sc - the service check object

serviceCheck

public void serviceCheck(ServiceCheck sc)
Description copied from interface: StatsDClient
Convenience method equivalent to StatsDClient.recordServiceCheckRun(ServiceCheck sc).

Specified by:
serviceCheck in interface StatsDClient


Copyright © 2015. All rights reserved.