Package com.codahale.metrics

Examples of com.codahale.metrics.Metric


    }

    @Test
    public void aMethodAnnotatedWithBothAMeteredAndAnExceptionCounter() throws Exception {

        final Metric meteredMetric = registry.getMeters().get(name(InstrumentedWithExceptionMetered.class,
            "meteredAndException", MeteredInterceptor.METERED_SUFFIX));

        final Metric errorMetric = registry.getMeters().get(name(InstrumentedWithExceptionMetered.class,
            "meteredAndException", DEFAULT_NAME_SUFFIX));

        assertThat("Guice creates a metric",
            meteredMetric,
            is(notNullValue()));
View Full Code Here


    }

    public DeltaTracker(MetricSupplier supplier) {
        for (Map.Entry<String, Metric> entry : supplier.getMetrics().entrySet()) {
            final String name = entry.getKey();
            final Metric metric = entry.getValue();
            if (metric instanceof Metered) {
                lookup.put(name, ((Metered) metric).getCount());
            }
            if (metric instanceof Histogram) {
                lookup.put(name, ((Histogram) metric).getCount());
View Full Code Here

    MetricRegistry result = new MetricRegistry();

    Collection<Map.Entry<String, Metric>> entries = metrics.entrySet();
    for(Map.Entry<String, Metric> entry : entries){
      String name = entry.getKey();
      Metric metric = entry.getValue();

      if(!filter.matches(name, metric)){
        continue;
      }
View Full Code Here

    return histogramData;
  }
 
  public void updateMetricData(MetricInfo metricInfo) {
    String name = metricInfo.getName();
    Metric metric = metricInfo.getMetric();
    if (metric instanceof QueueGauge) {
      //covert to %
      float queueRatio = (((QueueGauge) metric).getValue())*100;
      double value = JStormUtils.formatDoubleDecPoint2((double)queueRatio);
            gaugeData.put(name, value);
View Full Code Here

  // There are some metrics that have same metric name, but just different prefix.
  // e.g for netty_send_time, full metric name is dest_ip:port-name
  // The metrics with same metric name will be sum here.
    public void updateMetricData(MetricInfo metricInfo) {
      String name = metricInfo.getName();
    Metric metric = metricInfo.getMetric();
    LOG.debug("Metric name=" + name);
    if (metric instanceof QueueGauge) {
      //covert to %
      float queueRatio = (((QueueGauge) metric).getValue())*100;
      sum(gaugeData, name, (double)queueRatio);
View Full Code Here

TOP

Related Classes of com.codahale.metrics.Metric

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.