com.codahale.metrics.Clock.defaultClock()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(7.4k)|赞(0)|评价(0)|浏览(85)

本文整理了Java中com.codahale.metrics.Clock.defaultClock()方法的一些代码示例,展示了Clock.defaultClock()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Clock.defaultClock()方法的具体详情如下:
包路径:com.codahale.metrics.Clock
类名称:Clock
方法名:defaultClock

Clock.defaultClock介绍

[英]The default clock to use.
[中]要使用的默认时钟。

代码示例

代码示例来源:origin: AxonFramework/AxonFramework

/**
 * Creates a MessageTimerMonitor using a default clock
 */
public MessageTimerMonitor() {
  this(Clock.defaultClock());
}

代码示例来源:origin: AxonFramework/AxonFramework

/**
 * 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());
}

代码示例来源:origin: io.dropwizard.metrics/metrics-core

/**
 * 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());
}

代码示例来源:origin: io.dropwizard.metrics/metrics-core

/**
 * Creates a new {@link Meter}.
 */
public Meter() {
  this(Clock.defaultClock());
}

代码示例来源:origin: io.dropwizard.metrics/metrics-core

/**
 * 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());
}

代码示例来源:origin: io.dropwizard.metrics/metrics-core

/**
 * 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());
}

代码示例来源:origin: io.dropwizard.metrics/metrics-core

/**
 * 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());
}

代码示例来源:origin: io.dropwizard.metrics/metrics-core

/**
 * 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);
}

代码示例来源:origin: apache/incubator-gobblin

protected Builder() {
 this.name = "OutputStreamReporter";
 this.output = System.out;
 this.locale = Locale.getDefault();
 this.clock = Clock.defaultClock();
 this.timeZone = TimeZone.getDefault();
}

代码示例来源:origin: Graylog2/graylog2-server

public HdrTimer(long highestTrackableValue,
        TimeUnit unit,
        int numberOfSignificantValueDigits,
        Reservoir reservoir,
        Clock clock) {
  super(reservoir, clock);
  hdrHistogram = new HdrHistogram(unit.toNanos(highestTrackableValue), numberOfSignificantValueDigits);
}

代码示例来源:origin: io.dropwizard.metrics/metrics-core

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();
}

代码示例来源:origin: io.dropwizard.metrics/metrics-core

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();
}

代码示例来源:origin: aol/micro-server

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;
}

代码示例来源:origin: palantir/atlasdb

/**
 * 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)));
}

代码示例来源:origin: palantir/atlasdb

/**
 * 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);
          }));
}

代码示例来源:origin: palantir/atlasdb

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);
}

代码示例来源:origin: com.codahale.metrics/metrics-core

/**
 * Creates a new {@link Meter}.
 */
public Meter() {
  this(Clock.defaultClock());
}

代码示例来源:origin: jsevellec/cassandra-unit

/**
 * Construct a decaying histogram with default number of buckets and without considering zeroes.
 */
public DecayingEstimatedHistogramReservoir()
{
  this(DEFAULT_ZERO_CONSIDERATION, DEFAULT_BUCKET_COUNT, Clock.defaultClock());
}

代码示例来源:origin: com.codahale.metrics/metrics-core

/**
 * 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());
}

代码示例来源:origin: com.codahale.metrics/metrics-core

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;
}

相关文章

微信公众号

最新文章

更多