Search in sources :

Example 1 with HdrHistogramResetOnSnapshotReservoir

use of org.mpierce.metrics.reservoir.hdrhistogram.HdrHistogramResetOnSnapshotReservoir in project torodb by torodb.

the class ToroMetricRegistry method histogram.

/**
   *
   * @param name
   * @param resetOnSnapshot This is usually true if you're using snapshots as a means of defining
   *                        the window in which you want to calculate, say, the 99.9th percentile
   * @return
   */
public Histogram histogram(MetricName name, boolean resetOnSnapshot) {
    Reservoir reservoir;
    if (resetOnSnapshot) {
        reservoir = new HdrHistogramResetOnSnapshotReservoir();
    } else {
        reservoir = new HdrHistogramReservoir();
    }
    Histogram histogram = register(name, new Histogram(reservoir));
    return histogram;
}
Also used : HdrHistogramReservoir(org.mpierce.metrics.reservoir.hdrhistogram.HdrHistogramReservoir) Histogram(com.codahale.metrics.Histogram) HdrHistogramResetOnSnapshotReservoir(org.mpierce.metrics.reservoir.hdrhistogram.HdrHistogramResetOnSnapshotReservoir) HdrHistogramReservoir(org.mpierce.metrics.reservoir.hdrhistogram.HdrHistogramReservoir) HdrHistogramResetOnSnapshotReservoir(org.mpierce.metrics.reservoir.hdrhistogram.HdrHistogramResetOnSnapshotReservoir) Reservoir(com.codahale.metrics.Reservoir)

Example 2 with HdrHistogramResetOnSnapshotReservoir

use of org.mpierce.metrics.reservoir.hdrhistogram.HdrHistogramResetOnSnapshotReservoir in project torodb by torodb.

the class ToroMetricRegistry method timer.

/**
   *
   * @param name
   * @param resetOnSnapshot This is usually true if you're using snapshots as a means of defining
   *                        the window in which you want to calculate, say, the 99.9th percentile
   * @return
   */
public Timer timer(MetricName name, boolean resetOnSnapshot) {
    Reservoir reservoir;
    if (resetOnSnapshot) {
        reservoir = new HdrHistogramResetOnSnapshotReservoir();
    } else {
        reservoir = new HdrHistogramReservoir();
    }
    Timer timer = register(name, new Timer(reservoir));
    return timer;
}
Also used : HdrHistogramReservoir(org.mpierce.metrics.reservoir.hdrhistogram.HdrHistogramReservoir) Timer(com.codahale.metrics.Timer) HdrHistogramResetOnSnapshotReservoir(org.mpierce.metrics.reservoir.hdrhistogram.HdrHistogramResetOnSnapshotReservoir) HdrHistogramReservoir(org.mpierce.metrics.reservoir.hdrhistogram.HdrHistogramReservoir) HdrHistogramResetOnSnapshotReservoir(org.mpierce.metrics.reservoir.hdrhistogram.HdrHistogramResetOnSnapshotReservoir) Reservoir(com.codahale.metrics.Reservoir)

Aggregations

Reservoir (com.codahale.metrics.Reservoir)2 HdrHistogramReservoir (org.mpierce.metrics.reservoir.hdrhistogram.HdrHistogramReservoir)2 HdrHistogramResetOnSnapshotReservoir (org.mpierce.metrics.reservoir.hdrhistogram.HdrHistogramResetOnSnapshotReservoir)2 Histogram (com.codahale.metrics.Histogram)1 Timer (com.codahale.metrics.Timer)1