public void visit(MetricsVisitor visitor) { updateGaugeValues(percentile); visitor.gauge(this); } }
/** * Default constructor. It uses {@link SlidingTimeWindowReservoir} as the * default reservoir. * * @param name name of this timer */ public Timer(String name) { this(name, new SlidingTimeWindowReservoir()); }
/** * Updates the MetricsRegistery of this operator * @param startProcessing = begin processing of the message * @param endProcessing = end of processing */ private void updateMetrics(Instant startProcessing, Instant endProcessing) { queryInputEvents.inc(); processingTime.update(Duration.between(startProcessing, endProcessing).toMillis()); }
public static void incCounter(Counter counter) { if (counter != null) { counter.inc(); } }
public <T> ListGauge<T> newListGauge(String name) { return registry.newListGauge(groupName, new ListGauge(name)); }
public static void updateTimer(Timer timer, long duration) { if (timer != null) { timer.update(duration); } }
@Override public void run() { for (int i = 1; i <= 100; i++) { listGauge.add(i); } } });
@Override public T getValue() { return valueFunc.getValue(); } });
@Override public Map<String, Double> getTimerValues(String group, String timer) { return getMetricValues(group, timer, "AverageTime"); } }
/** * {@inheritDoc} */ @Override public void visit(MetricsVisitor visitor) { visitor.listGauge(this); }
/** * Construct a {@link Timer} with given window size and collision buffer * * @param name name of this timer * @param windowMs the window size. unit is millisecond * @param collisionBuffer amount of collisions allowed in one millisecond. * @param clock the clock for the reservoir */ public Timer(String name, long windowMs, int collisionBuffer, Clock clock) { this(name, new SlidingTimeWindowReservoir(windowMs, collisionBuffer, clock)); }
@Override public void run() { for (int i = 1; i <= 100; i++) { listGauge.add(i); } } });
/** * Construct a {@link Timer} with given window size * * @param name name of this timer * @param windowMs the window size. unit is millisecond * @param clock the clock for the reservoir */ public Timer(String name, long windowMs, Clock clock) { this(name, new SlidingTimeWindowReservoir(windowMs, clock)); }