protected ScheduledReporter(MetricRegistry registry, String name, MetricFilter filter, TimeUnit rateUnit, TimeUnit durationUnit, ScheduledExecutorService executor, boolean shutdownExecutorOnStop, Set<MetricAttribute> disabledMetricAttributes) { this.registry = registry; this.filter = filter; this.executor = executor == null ? createDefaultExecutor(name) : executor; this.shutdownExecutorOnStop = shutdownExecutorOnStop; this.rateFactor = rateUnit.toSeconds(1); this.rateUnit = calculateRateUnit(rateUnit); this.durationFactor = durationUnit.toNanos(1); this.durationUnit = durationUnit.toString().toLowerCase(Locale.US); this.disabledMetricAttributes = disabledMetricAttributes != null ? disabledMetricAttributes : Collections.emptySet(); }
/** * Creates a new {@link ScheduledReporter} instance. * * @param registry the {@link com.codahale.metrics.MetricRegistry} containing the metrics this * reporter will report * @param name the reporter's name * @param filter the filter for which metrics to report */ protected ScheduledReporter(MetricRegistry registry, String name, MetricFilter filter, TimeUnit rateUnit, TimeUnit durationUnit) { this.registry = registry; this.filter = filter; this.executor = Executors.newSingleThreadScheduledExecutor(new NamedThreadFactory(name)); this.rateFactor = rateUnit.toSeconds(1); this.rateUnit = calculateRateUnit(rateUnit); this.durationFactor = 1.0 / durationUnit.toNanos(1); this.durationUnit = durationUnit.toString().toLowerCase(Locale.US); }
/** * Creates a new {@link ScheduledReporter} instance. * * @param registry the {@link com.codahale.metrics.MetricRegistry} containing the metrics this * reporter will report * @param name the reporter's name * @param filter the filter for which metrics to report */ protected ScheduledReporter(MetricRegistry registry, String name, MetricFilter filter, TimeUnit rateUnit, TimeUnit durationUnit) { this.registry = registry; this.filter = filter; this.executor = Executors.newSingleThreadScheduledExecutor(new NamedThreadFactory(name)); this.rateFactor = rateUnit.toSeconds(1); this.rateUnit = calculateRateUnit(rateUnit); this.durationFactor = 1.0 / durationUnit.toNanos(1); this.durationUnit = durationUnit.toString().toLowerCase(Locale.US); }