public <T> T invoke(final Runnable r, T result) throws Exception { this.invoke(r); return result; }
/** Default constructor. */ public PerformanceMonitor() { createMovingAverages(); }
@ManagedAttribute @Override public long get95thPercentileSuccessLatencyLastDay() { return super.get95thPercentileSuccessLatencyLastDay(); }
@ManagedAttribute @Override public long get95thPercentileSuccessLatencyLastMinute() { return super.get95thPercentileSuccessLatencyLastMinute(); }
@ManagedAttribute @Override public long get95thPercentileFailureLatencyLastMinute() { return super.get95thPercentileFailureLatencyLastMinute(); }
@ManagedAttribute @Override public long get95thPercentileFailureLatencyLastHour() { return super.get95thPercentileFailureLatencyLastHour(); }
@ManagedAttribute @Override public long get95thPercentileFailureLatencyLastDay() { return super.get95thPercentileFailureLatencyLastDay(); }
@ManagedAttribute @Override public long get95thPercentileSuccessLatencyLastHour() { return super.get95thPercentileSuccessLatencyLastHour(); }
@ManagedAttribute @Override public long get95thPercentileFailureLatencyLifetime() { return super.get95thPercentileFailureLatencyLifetime(); }
/** * Create a new {@link PerformanceMonitor} and map it to the provided name. * If the PerformanceMonitor already exists, then the existing instance is * returned. * @param name the name for the {@link PerformanceMonitor} * @return the created {@link PerformanceMonitor} */ public synchronized PerformanceMonitor createPerformanceMonitor(String name) { PerformanceMonitor performanceMonitor = findPerformanceMonitor(name); if (performanceMonitor == null) { performanceMonitor = new PerformanceMonitor(); addPerformanceMonitorToMap(name, performanceMonitor); } return performanceMonitor; }
return performanceMonitor.invoke( new Callable<Object>() { public Object call() throws Exception {