@Override public void update(int value) { delegate.update(value); }
@Override public void update(long value) { delegate.update(value); }
private void update(long nanos) { if (nanos >= 0) { histogram.update(nanos); meter.mark(); } }
histogram = getHistogram(method, BULKHEAD_WAITING_DURATION); histogram.update(System.nanoTime() - queuedNanos);
.update(command.getExecutionTime()); getCounter(method, cause instanceof TimeoutException ? TIMEOUT_CALLS_TIMED_OUT_TOTAL boolean bulkheadRejection = (cause instanceof RejectedExecutionException); if (!bulkheadRejection) { getHistogram(method, BULKHEAD_EXECUTION_DURATION).update(command.getExecutionTime());
public void update(long n) { histogram.update(n); } }
@Override public void update(final long duration, final TimeUnit unit) { if (duration >= 0) { histogram.update(unit.toNanos(duration)); meter.mark(); } }
private void histogramUpdate(String name, long value) { histogramOf(name).update(value); }
public void histogramMe() { Metadata metadata = new Metadata("metricTest.test1.histogram", MetricType.HISTOGRAM, MetricUnits.BYTES); Histogram histogram = metrics.histogram(metadata); // Go both ways to minimize error due to decay for (int i = 0; i < 500; i++) { histogram.update(i); histogram.update(999 - i); } Metadata metadata2 = new Metadata("metricTest.test1.histogram2", MetricType.HISTOGRAM,MetricUnits.NONE); Histogram histogram2 = metrics.histogram(metadata2); histogram2.update(1); }
@Override protected Object run() throws Exception { if (registry != null && operation.hasBulkhead()) { // TODO: in fact, we do not record the time spent in the queue but the time between command creation and command execution histogramOf(MetricNames.metricsPrefix(operation.getMethod()) + MetricNames.BULKHEAD_WAITING_DURATION).update(System.nanoTime() - queuedAt); } return callable.call(); }
private void updateExecutionSuccessfulMetrics(ExecutionMetadata metadata, InvocationContext invocationContext, HystrixCommand cmd) { Optional<TimeoutMetricsCollection> metricsCollection = metadata.getTimeoutMetricsCollection(invocationContext .getMethod().getName()); if (metricsCollection.isPresent()) { metricsCollection.get().getExecutionDuration().update(cmd.getExecutionTimeInMilliseconds() * 1000000); metricsCollection.get().getCallsNotTimedOut().inc(); } metadata.getCbMetricsCollection(invocationContext.getMethod().getName()) .ifPresent(c -> c.getCallsSucceeded().inc()); }
public void badRegisterReusableMixed() { Metadata metadata = new Metadata("badReusableMixed", MetricType.HISTOGRAM); metadata.setReusable(true); Histogram histogram = registry.histogram(metadata); histogram.update(1); // We register a different metric type - that is forbidden // so we expect an exception Metadata metadata2 = new Metadata("badReusableMixed", MetricType.COUNTER); metadata2.setReusable(true); registry.counter(metadata2); }
metadata.getTimeoutMetricsCollection(invocationContext.getMethod().getName()) .ifPresent(c -> c.getExecutionDuration() .update(cmd.getExecutionTimeInMilliseconds() * 1000000)); metadata.getTimeoutMetricsCollection(invocationContext.getMethod().getName()) .ifPresent(c -> c.getCallsTimedOut().inc());