Package com.codahale.metrics

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


      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


    }
    cycleReference.get().postExecute();
    final long durationNanos = cycleReference.get().getDuration().toNanos();
    final Timer timer = deltaCycle != null ? _deltaCycleTimer : _fullCycleTimer;
    if (timer != null) {
      timer.update(durationNanos, TimeUnit.NANOSECONDS);
    }
    _totalTimeNanos += durationNanos;
    _cycleCount += 1;
    s_logger.info("Last latency was {} ms, Average latency is {} ms",
        durationNanos / NANOS_PER_MILLISECOND,
View Full Code Here

    }

    @Override
    public void collect(long elapsedTime, StatementContext ctx) {
        final Timer timer = getTimer(ctx);
        timer.update(elapsedTime, TimeUnit.NANOSECONDS);
    }

    private Timer getTimer(StatementContext ctx) {
        return registry.timer(statementNameStrategy.getStatementName(ctx));
    }
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.