Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
/** A Counter is a metric measured by incrementing and decrementing. */
@Public
public interface Counter extends Metric {

    /** Increment the current count by 1. */
    void inc();

    /**
     * Increment the current count by the given value.
     *
     * @param n value to increment the current count by
     */
    void inc(long n);

    /** Decrement the current count by 1. */
    void dec();

    /**
     * Decrement the current count by the given value.
     *
     * @param n value to decrement the current count by
     */
    void dec(long n);

    /**
     * Returns the current count.
     *
     * @return current count
     */
    long getCount();
}

Histogram

Histogram is a type of metric interface measure the statistical distribution of a set of values including the min, max, mean, standard deviation and quantiles

Code Block
/** The histogram allows to record values, get the current count of recorded values and create
 * histogram statistics for the currently seen elements.*/
@Public
public interface Histogram extends Metric {

    /**
     * Update the histogram with the given value.
     *
     * @param value Value to update the histogram with
     */
    void update(long value);

    /**
     * Get the count of seen elements.
     *
     * @return Count of seen elements
     */
    long getCount();

    /**
     * Create statistics for the currently recorded elements.
     *
     * @return Statistics about the currently recorded elements
     */
    HistogramStatistics getStatistics();
}


Metrics

Class Metrics  is the core of metrics system, there are  MetricRegistry  and  MetricsReporter  container in it. When the Metrics  instance is initiating, the MetricRegistry  is instantiated and metrics reporters are started. 

...