Package com.codahale.metrics

Examples of com.codahale.metrics.Meter.mark()


        public void onEvent(RequestEvent event) {
            if (event.getType() == RequestEvent.Type.RESOURCE_METHOD_START) {
                final Meter meter = this.meters.get(event.getUriInfo()
                        .getMatchedResourceMethod().getInvocable().getDefinitionMethod());
                if (meter != null) {
                    meter.mark();
                }
            }
        }
    }
View Full Code Here


    }

    private void markMeterForStatusCode(int status) {
        final Meter metric = metersByStatusCode.get(status);
        if (metric != null) {
            metric.mark();
        } else {
            otherMeter.mark();
        }
    }
View Full Code Here

      r0 = startConsoleReporter(registry);
      r1 = startInfluxdbReporter(registry);

      final Meter mymeter0 = registry.meter("MyMeter.0");
      for (int i = 0; i < 100; i++) {
        mymeter0.mark();
        mymeter0.mark(Math.round(Math.random() * 100.0));
        Thread.sleep(Math.round(Math.random() * 1000.0));
      }
    } catch (Exception exc) {
      exc.printStackTrace();
View Full Code Here

      r1 = startInfluxdbReporter(registry);

      final Meter mymeter0 = registry.meter("MyMeter.0");
      for (int i = 0; i < 100; i++) {
        mymeter0.mark();
        mymeter0.mark(Math.round(Math.random() * 100.0));
        Thread.sleep(Math.round(Math.random() * 1000.0));
      }
    } catch (Exception exc) {
      exc.printStackTrace();
      System.exit(1);
View Full Code Here

        Message in = exchange.getIn();
        Meter meter = registry.meter(metricsName);
        Long mark = endpoint.getMark();
        Long finalMark = getLongHeader(in, HEADER_METER_MARK, mark);
        if (finalMark == null) {
            meter.mark();
        } else {
            meter.mark(finalMark);
        }
    }
}
View Full Code Here

        Long mark = endpoint.getMark();
        Long finalMark = getLongHeader(in, HEADER_METER_MARK, mark);
        if (finalMark == null) {
            meter.mark();
        } else {
            meter.mark(finalMark);
        }
    }
}
View Full Code Here

    String metricName = stepName == null ?
        name(group, jobName, JOB_KIND, METERED_KIND) :
        name(group, jobName, STEP_KIND, stepName, STEP_KIND, METERED_KIND);

    Meter meter = metricRegistry.meter(metricName);
    meter.mark();
  }

  @Override
  public void destroy() throws Exception {
    meters.clear();
View Full Code Here

            Meter meter = keyNotFoundInCFMap.get(CF);
            if (meter == null) {
                meter = Metrics.meter(Instrumentation.class, "reads", "Not Found", CF.getName());
                keyNotFoundInCFMap.put(CF, meter);
            }
            meter.mark();
        }
    }

    public static void markScanAllColumnFamilies() {
        scanAllColumnFamiliesMeter.mark();
View Full Code Here

        Meter meter
            = metricsServiceProvider
                .get()
                .getMetricRegistry()
                .meter(timerName);
        meter.mark();

        try {
            return invocation.proceed();
        } finally {
View Full Code Here

  public void increment(Delta<?> delta) {
    String name = delta.getName();
    long value = delta.getValue().longValue();
    if (name.startsWith("meter")) {
      Meter meter = this.registry.meter(name);
      meter.mark(value);
    }
    else {
      Counter counter = this.registry.counter(name);
      counter.inc(value);
    }
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.