Package com.codahale.metrics

Examples of com.codahale.metrics.Histogram.update()


     * @param name Metric name.
     * @param value Metric value.
     */
    public void update(final String name, final long value) {
        final Histogram histogram = getHistogram(name);
        histogram.update(value);
    }

    /**
     * {@inheritDoc}
     */
 
View Full Code Here


        Message in = exchange.getIn();
        Histogram histogram = registry.histogram(metricsName);
        Long value = endpoint.getValue();
        Long finalValue = getLongHeader(in, HEADER_HISTOGRAM_VALUE, value);
        if (finalValue != null) {
            histogram.update(finalValue);
        } else {
            LOG.warn("Cannot update histogram \"{}\" with null value", metricsName);
        }
    }
}
View Full Code Here

      final MetricRegistry registry = new MetricRegistry();
      final Histogram histogram = registry.histogram("foo");

      for (final FastWorker w : workers) {
         histogram.update(w.iterations);
      }
     
      final Logger logger = LoggerFactory.getLogger(getClass());
      final Snapshot snapshot = histogram.getSnapshot();
      logger.info("Min: {}, Max: {}. Median: {}", snapshot.getMin(), snapshot.getMax(), (int) snapshot.getMedian());
View Full Code Here

  public void set(Metric<?> value) {
    String name = value.getName();
    if (name.startsWith("histogram")) {
      long longValue = value.getValue().longValue();
      Histogram metric = this.registry.histogram(name);
      metric.update(longValue);
    }
    else if (name.startsWith("timer")) {
      long longValue = value.getValue().longValue();
      Timer metric = this.registry.timer(name);
      metric.update(longValue, TimeUnit.MILLISECONDS);
View Full Code Here

      metric.update(longValue);
    }
    else if (name.startsWith("timer")) {
      long longValue = value.getValue().longValue();
      Timer metric = this.registry.timer(name);
      metric.update(longValue, TimeUnit.MILLISECONDS);
    }
    else {
      final double gauge = value.getValue().doubleValue();
      Object lock = null;
      if (this.gaugeLocks.containsKey(name)) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.