/** * Creates a MessageTimerMonitor using a default clock */ public MessageTimerMonitor() { this(Clock.defaultClock()); }
/** * Creates a capacity monitor with the default time window 10 minutes * * @param window The length of the window to measure the capacity over * @param timeUnit The time unit of the time window */ public CapacityMonitor(long window, TimeUnit timeUnit) { this(window, timeUnit, Clock.defaultClock()); }
/** * Creates a new {@link ExponentiallyDecayingReservoir}. * * @param size the number of samples to keep in the sampling reservoir * @param alpha the exponential decay factor; the higher this is, the more biased the reservoir * will be towards newer values */ public ExponentiallyDecayingReservoir(int size, double alpha) { this(size, alpha, Clock.defaultClock()); }
/** * Creates a new {@link Meter}. */ public Meter() { this(Clock.defaultClock()); }
/** * Creates a new {@link Timer} that uses the given {@link Reservoir}. * * @param reservoir the {@link Reservoir} implementation the timer should use */ public Timer(Reservoir reservoir) { this(reservoir, Clock.defaultClock()); }
/** * Creates a new {@link SlidingTimeWindowReservoir} with the given window of time. * * @param window the window of time * @param windowUnit the unit of {@code window} */ public SlidingTimeWindowReservoir(long window, TimeUnit windowUnit) { this(window, windowUnit, Clock.defaultClock()); }
/** * Creates a new {@link SlidingTimeWindowArrayReservoir} with the given window of time. * * @param window the window of time * @param windowUnit the unit of {@code window} */ public SlidingTimeWindowArrayReservoir(long window, TimeUnit windowUnit) { this(window, windowUnit, Clock.defaultClock()); }
/** * Creates a new cached gauge with the given timeout period. * * @param timeout the timeout * @param timeoutUnit the unit of {@code timeout} */ protected CachedGauge(long timeout, TimeUnit timeoutUnit) { this(Clock.defaultClock(), timeout, timeoutUnit); }
protected Builder() { this.name = "OutputStreamReporter"; this.output = System.out; this.locale = Locale.getDefault(); this.clock = Clock.defaultClock(); this.timeZone = TimeZone.getDefault(); }
public HdrTimer(long highestTrackableValue, TimeUnit unit, int numberOfSignificantValueDigits, Reservoir reservoir, Clock clock) { super(reservoir, clock); hdrHistogram = new HdrHistogram(unit.toNanos(highestTrackableValue), numberOfSignificantValueDigits); }
private Builder(MetricRegistry registry) { this.registry = registry; this.output = System.out; this.locale = Locale.getDefault(); this.clock = Clock.defaultClock(); this.timeZone = TimeZone.getDefault(); this.rateUnit = TimeUnit.SECONDS; this.durationUnit = TimeUnit.MILLISECONDS; this.filter = MetricFilter.ALL; this.executor = null; this.shutdownExecutorOnStop = true; disabledMetricAttributes = Collections.emptySet(); }
private Builder(MetricRegistry registry) { this.registry = registry; this.locale = Locale.getDefault(); this.separator = DEFAULT_SEPARATOR; this.rateUnit = TimeUnit.SECONDS; this.durationUnit = TimeUnit.MILLISECONDS; this.clock = Clock.defaultClock(); this.filter = MetricFilter.ALL; this.executor = null; this.shutdownExecutorOnStop = true; this.csvFileProvider = new FixedNameCsvFileProvider(); }
private Builder(MetricRegistry registry) { this.registry = registry; this.output = System.out; this.locale = Locale.getDefault(); this.clock = Clock.defaultClock(); this.timeZone = TimeZone.getDefault(); this.rateUnit = TimeUnit.SECONDS; this.durationUnit = TimeUnit.MILLISECONDS; this.filter = MetricFilter.ALL; }
/** * Registers a gauge which tracks the current value of the validity bound. Under normal operation and within the * lifetiem of a single JVM, this should not decrease. * * @param metricsManager metrics manager to register the gauge on * @param metadataCoordinationService metadata coordination service that should be tracked */ private static void registerValidityBoundMetric(MetricsManager metricsManager, CoordinationService<InternalSchemaMetadata> metadataCoordinationService) { metricsManager.registerMetric( MetadataCoordinationServiceMetrics.class, AtlasDbMetricNames.COORDINATION_LAST_VALID_BOUND, TrackerUtils.createCachingExceptionHandlingGauge( log, Clock.defaultClock(), AtlasDbMetricNames.COORDINATION_LAST_VALID_BOUND, () -> metadataCoordinationService.getLastKnownLocalValue() .map(ValueAndBound::bound) .orElse(Long.MIN_VALUE))); }
/** * Registers a gauge which tracks the eventual transactions schema version - that is, at the end of the current * period of validity for the bound, what the metadata says the transactions schema version should be. * * @param metricsManager metrics manager to register the gauge on * @param metadataCoordinationService metadata coordination service that should be tracked */ private static void registerEventualTransactionsSchemaVersionMetric(MetricsManager metricsManager, CoordinationService<InternalSchemaMetadata> metadataCoordinationService) { metricsManager.registerMetric( MetadataCoordinationServiceMetrics.class, AtlasDbMetricNames.COORDINATION_EVENTUAL_TRANSACTIONS_SCHEMA_VERSION, TrackerUtils.createCachingExceptionHandlingGauge( log, Clock.defaultClock(), AtlasDbMetricNames.COORDINATION_EVENTUAL_TRANSACTIONS_SCHEMA_VERSION, () -> { Optional<ValueAndBound<InternalSchemaMetadata>> latestValue = metadataCoordinationService.getLastKnownLocalValue(); return latestValue .map(ValueAndBound::value) .flatMap(Function.identity()) .map(InternalSchemaMetadata::timestampToTransactionsTableSchemaVersion) .map(timestampMap -> timestampMap.getValueForTimestamp(latestValue.get().bound())) .orElse(null); })); }
public static void instrumentTimestamps( MetricsManager metricsManager, TimelockService timeLockService, Cleaner cleaner) { Clock clock = Clock.defaultClock(); registerTimestampForTracking(clock, metricsManager, "timestamp.fresh", timeLockService::getFreshTimestamp); registerTimestampForTracking( clock, metricsManager, "timestamp.immutable", timeLockService::getImmutableTimestamp); registerTimestampForTracking(clock, metricsManager, "timestamp.unreadable", cleaner::getUnreadableTimestamp); }
/** * Creates a new {@link Meter}. */ public Meter() { this(Clock.defaultClock()); }
/** * Construct a decaying histogram with default number of buckets and without considering zeroes. */ public DecayingEstimatedHistogramReservoir() { this(DEFAULT_ZERO_CONSIDERATION, DEFAULT_BUCKET_COUNT, Clock.defaultClock()); }
/** * Creates a new {@link Timer} that uses the given {@link Reservoir}. * * @param reservoir the {@link Reservoir} implementation the timer should use */ public Timer(Reservoir reservoir) { this(reservoir, Clock.defaultClock()); }
private Builder(MetricRegistry registry) { this.registry = registry; this.locale = Locale.getDefault(); this.rateUnit = TimeUnit.SECONDS; this.durationUnit = TimeUnit.MILLISECONDS; this.clock = Clock.defaultClock(); this.filter = MetricFilter.ALL; }