Package com.yammer.metrics.stats

Examples of com.yammer.metrics.stats.Snapshot


        processMeter(name, timer, context);

        List<Dimension> dimensions = createDimensions(name, timer);
        String sanitizedName = sanitizeName(name);
        Snapshot snapshot = timer.getSnapshot();
        for (double percentile : percentilesToSend) {
            if (percentile == .5) {
                sendValue(context, sanitizedName + ".median", convertIfNecessary(snapshot.getMedian(), recordedUnit, sendUnit), cloudWatchUnit, dimensions);
            } else {
                sendValue(context, sanitizedName + "_percentile_" + percentile, convertIfNecessary(snapshot.getValue(percentile), recordedUnit, sendUnit), cloudWatchUnit, dimensions);
            }
        }
        if (sendTimerLifetime) {
            sendValue(context, sanitizedName + ".min", convertIfNecessary(timer.min(), recordedUnit, sendUnit), cloudWatchUnit, dimensions);
            sendValue(context, sanitizedName + ".max", convertIfNecessary(timer.max(), recordedUnit, sendUnit), cloudWatchUnit, dimensions);
View Full Code Here


        sendFloat(sanitizedName + ".mean", StatType.TIMER, metric.mean());
        sendFloat(sanitizedName + ".stddev", StatType.TIMER, metric.stdDev());
    }

    protected void sendSampling(String sanitizedName, Sampling metric) throws IOException {
        final Snapshot snapshot = metric.getSnapshot();
        sendFloat(sanitizedName + ".median", StatType.TIMER, snapshot.getMedian());
        sendFloat(sanitizedName + ".75percentile", StatType.TIMER, snapshot.get75thPercentile());
        sendFloat(sanitizedName + ".95percentile", StatType.TIMER, snapshot.get95thPercentile());
        sendFloat(sanitizedName + ".98percentile", StatType.TIMER, snapshot.get98thPercentile());
        sendFloat(sanitizedName + ".99percentile", StatType.TIMER, snapshot.get99thPercentile());
        sendFloat(sanitizedName + ".999percentile", StatType.TIMER, snapshot.get999thPercentile());
    }
View Full Code Here

        printReportToConsole(lastReport);

        if (latenciesMiddle == null)
            return;

        Snapshot snapshot = latenciesMiddle.getSnapshot();

        System.out.println();
        System.out.println("For the middle 80% of values:");
        System.out.println(String.format("  Mean rate (ops/sec):          %10.1f", meanMiddleRate));
        System.out.println(String.format("  Mean latency (ms):            %10.3f", latenciesMiddle.mean()));
        System.out.println(String.format("  Median latency (ms):          %10.3f", snapshot.getMedian()));
        System.out.println(String.format("  75th percentile latency (ms): %10.3f", snapshot.get75thPercentile()));
        System.out.println(String.format("  95th percentile latency (ms): %10.3f", snapshot.get95thPercentile()));
        System.out.println(String.format("  99th percentile latency (ms): %10.3f", snapshot.get99thPercentile()));
        System.out.println(String.format("  Standard latency deviation:   %10.3f", latenciesMiddle.stdDev()));
    }
View Full Code Here

            this.totalOps = meter.count();
            this.intervalRate = totalOps - lastOpCount;
            this.meanRate = meter.meanRate();

            Snapshot snapshot = timer.getSnapshot();
            this.meanLatency = timer.mean();
            this.latency95th = snapshot.get95thPercentile();
            this.latency99th = snapshot.get99thPercentile();
            this.stdDev = timer.stdDev();
        }
View Full Code Here

  }

  @Override
  public void processHistogram(final MetricName name,
      final Histogram histogram, final PrintStream stream) {
    final Snapshot snapshot = histogram.getSnapshot();
    stream.printf(locale, "               min = %,2.2f\n", histogram.min());
    stream.printf(locale, "               max = %,2.2f\n", histogram.max());
    stream.printf(locale, "              mean = %,2.2f\n", histogram.mean());
    stream.printf(locale, "            stddev = %,2.2f\n",
        histogram.stdDev());
    stream.printf(locale, "            median = %,2.2f\n",
        snapshot.getMedian());
    stream.printf(locale, "              75%% <= %,2.2f\n",
        snapshot.get75thPercentile());
    stream.printf(locale, "              95%% <= %,2.2f\n",
        snapshot.get95thPercentile());
    stream.printf(locale, "              98%% <= %,2.2f\n",
        snapshot.get98thPercentile());
    stream.printf(locale, "              99%% <= %,2.2f\n",
        snapshot.get99thPercentile());
    stream.printf(locale, "            99.9%% <= %,2.2f\n",
        snapshot.get999thPercentile());
  }
View Full Code Here

  @Override
  public void processTimer(final MetricName name, final Timer timer,
      final PrintStream stream) {
    processMeter(name, timer, stream);
    final String durationUnit = abbrev(timer.durationUnit());
    final Snapshot snapshot = timer.getSnapshot();
    stream.printf(locale, "               min = %,2.2f %s\n", timer.min(),
        durationUnit);
    stream.printf(locale, "               max = %,2.2f %s\n", timer.max(),
        durationUnit);
    stream.printf(locale, "              mean = %,2.2f %s\n", timer.mean(),
        durationUnit);
    stream.printf(locale, "            stddev = %,2.2f %s\n",
        timer.stdDev(), durationUnit);
    stream.printf(locale, "            median = %,2.2f %s\n",
        snapshot.getMedian(), durationUnit);
    stream.printf(locale, "              75%% <= %,2.2f %s\n",
        snapshot.get75thPercentile(), durationUnit);
    stream.printf(locale, "              95%% <= %,2.2f %s\n",
        snapshot.get95thPercentile(), durationUnit);
    stream.printf(locale, "              98%% <= %,2.2f %s\n",
        snapshot.get98thPercentile(), durationUnit);
    stream.printf(locale, "              99%% <= %,2.2f %s\n",
        snapshot.get99thPercentile(), durationUnit);
    stream.printf(locale, "            99.9%% <= %,2.2f %s\n",
        snapshot.get999thPercentile(), durationUnit);
  }
View Full Code Here

        sendFloat(sanitizedName + ".mean", StatType.TIMER, metric.mean());
        sendFloat(sanitizedName + ".stddev", StatType.TIMER, metric.stdDev());
    }

    protected void sendSampling(String sanitizedName, Sampling metric) throws IOException {
        final Snapshot snapshot = metric.getSnapshot();
        sendFloat(sanitizedName + ".median", StatType.TIMER, snapshot.getMedian());
        sendFloat(sanitizedName + ".75percentile", StatType.TIMER, snapshot.get75thPercentile());
        sendFloat(sanitizedName + ".95percentile", StatType.TIMER, snapshot.get95thPercentile());
        sendFloat(sanitizedName + ".98percentile", StatType.TIMER, snapshot.get98thPercentile());
        sendFloat(sanitizedName + ".99percentile", StatType.TIMER, snapshot.get99thPercentile());
        sendFloat(sanitizedName + ".999percentile", StatType.TIMER, snapshot.get999thPercentile());
    }
View Full Code Here

  }

  @Override
  public void processHistogram(final MetricName name,
      final Histogram histogram, final PrintStream stream) {
    final Snapshot snapshot = histogram.getSnapshot();
    stream.printf(locale, "               min = %,2.2f\n", histogram.min());
    stream.printf(locale, "               max = %,2.2f\n", histogram.max());
    stream.printf(locale, "              mean = %,2.2f\n", histogram.mean());
    stream.printf(locale, "            stddev = %,2.2f\n",
        histogram.stdDev());
    stream.printf(locale, "            median = %,2.2f\n",
        snapshot.getMedian());
    stream.printf(locale, "              75%% <= %,2.2f\n",
        snapshot.get75thPercentile());
    stream.printf(locale, "              95%% <= %,2.2f\n",
        snapshot.get95thPercentile());
    stream.printf(locale, "              98%% <= %,2.2f\n",
        snapshot.get98thPercentile());
    stream.printf(locale, "              99%% <= %,2.2f\n",
        snapshot.get99thPercentile());
    stream.printf(locale, "            99.9%% <= %,2.2f\n",
        snapshot.get999thPercentile());
  }
View Full Code Here

  @Override
  public void processTimer(final MetricName name, final Timer timer,
      final PrintStream stream) {
    processMeter(name, timer, stream);
    final String durationUnit = abbrev(timer.durationUnit());
    final Snapshot snapshot = timer.getSnapshot();
    stream.printf(locale, "               min = %,2.2f %s\n", timer.min(),
        durationUnit);
    stream.printf(locale, "               max = %,2.2f %s\n", timer.max(),
        durationUnit);
    stream.printf(locale, "              mean = %,2.2f %s\n", timer.mean(),
        durationUnit);
    stream.printf(locale, "            stddev = %,2.2f %s\n",
        timer.stdDev(), durationUnit);
    stream.printf(locale, "            median = %,2.2f %s\n",
        snapshot.getMedian(), durationUnit);
    stream.printf(locale, "              75%% <= %,2.2f %s\n",
        snapshot.get75thPercentile(), durationUnit);
    stream.printf(locale, "              95%% <= %,2.2f %s\n",
        snapshot.get95thPercentile(), durationUnit);
    stream.printf(locale, "              98%% <= %,2.2f %s\n",
        snapshot.get98thPercentile(), durationUnit);
    stream.printf(locale, "              99%% <= %,2.2f %s\n",
        snapshot.get99thPercentile(), durationUnit);
    stream.printf(locale, "            99.9%% <= %,2.2f %s\n",
        snapshot.get999thPercentile(), durationUnit);
  }
View Full Code Here

    }

    @Override
    public void processHistogram(final MetricName name,
            final Histogram histogram, final PrintStream stream) {
        final Snapshot snapshot = histogram.getSnapshot();
        stream.printf(locale, "               min = %,2.2f\n", histogram.min());
        stream.printf(locale, "               max = %,2.2f\n", histogram.max());
        stream.printf(locale, "              mean = %,2.2f\n", histogram.mean());
        stream.printf(locale, "            stddev = %,2.2f\n",
                histogram.stdDev());
        stream.printf(locale, "            median = %,2.2f\n",
                snapshot.getMedian());
        stream.printf(locale, "              75%% <= %,2.2f\n",
                snapshot.get75thPercentile());
        stream.printf(locale, "              95%% <= %,2.2f\n",
                snapshot.get95thPercentile());
        stream.printf(locale, "              98%% <= %,2.2f\n",
                snapshot.get98thPercentile());
        stream.printf(locale, "              99%% <= %,2.2f\n",
                snapshot.get99thPercentile());
        stream.printf(locale, "            99.9%% <= %,2.2f\n",
                snapshot.get999thPercentile());
    }
View Full Code Here

TOP

Related Classes of com.yammer.metrics.stats.Snapshot

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.