Java 类com.codahale.metrics.Clock 实例源码

项目:sstable-adaptor    文件:DecayingEstimatedHistogramReservoir.java   
@VisibleForTesting
DecayingEstimatedHistogramReservoir(boolean considerZeroes, int bucketCount, Clock clock)
{
    if (bucketCount == DEFAULT_BUCKET_COUNT)
    {
        if (considerZeroes == true)
        {
            bucketOffsets = DEFAULT_WITH_ZERO_BUCKET_OFFSETS;
        }
        else
        {
            bucketOffsets = DEFAULT_WITHOUT_ZERO_BUCKET_OFFSETS;
        }
    }
    else
    {
        bucketOffsets = EstimatedHistogram.newOffsets(bucketCount, considerZeroes);
    }
    decayingBuckets = new AtomicLongArray(bucketOffsets.length + 1);
    buckets = new AtomicLongArray(bucketOffsets.length + 1);
    this.clock = clock;
    decayLandmark = clock.getTime();
}
项目:JInsight    文件:HttpAsyncClientRuleHelper.java   
public void onResponseReceived(HttpRequest request, HttpResponse response) {
  Long startTime = removeObjectProperty(request, START_TIME_PROPERTY_NAME);
  if (startTime == null) {
    return;
  }

  long t = Clock.defaultClock().getTick() - startTime;

  String method = request.getRequestLine().getMethod();
  int statusCode = response.getStatusLine().getStatusCode();

  String metricName = ROOT_NAME.withTags(
      "method", method,
      "status", "" + statusCode).toString();
  Timer timer = RegistryService.getMetricRegistry().timer(metricName);
  timer.update(t, TimeUnit.NANOSECONDS);

}
项目:JInsight    文件:UrlConnectionRuleHelper.java   
public void onGetInputStream(HttpURLConnection urlConnection, int statusCode) {
  Long startTime = removeObjectProperty(urlConnection, START_TIME_PROPERTY_NAME);
  if (startTime == null) {
    return;
  }

  long t = Clock.defaultClock().getTick() - startTime;
  String method = urlConnection.getRequestMethod();
  String status = "" + statusCode;
  Timer timer = timers.computeIfAbsent(status + method, s -> {
    TagEncodedMetricName metricName = ROOT_NAME.withTags(
        "method", method,
        "status", status);
    return getTimer(metricName);
  });

  timer.update(t, TimeUnit.NANOSECONDS);
}
项目:spelk    文件:ElasticsearchReporter.java   
private ElasticsearchReporter(MetricRegistry registry, MetricFilter filter, TimeUnit rateUnit,
        TimeUnit durationUnit, String host, String port, String indexName, String timestampField) {

    super(registry, "elasticsearch-reporter", filter, rateUnit, durationUnit);

    this.clock = Clock.defaultClock();
    this.connector = new ElasticsearchConnector(host, port, indexName);
    this.timestampField = timestampField;
    this.timestampFormat = new SimpleDateFormat(timeStampString);
    this.localhost = Utils.localHostName();

    jsonFactory = new JsonFactory();

    indexInitialized = connector.addDefaultMappings();
    if (!indexInitialized) {
        LOGGER.warn("Failed to initialize Elasticsearch index '" + indexName + "' on " + host + ":" + port);
    }
}
项目:hawkular-dropwizard-reporter    文件:HawkularReporter.java   
HawkularReporter(MetricRegistry registry,
                 HawkularHttpClient hawkularClient,
                 Optional<String> prefix,
                 MetricsDecomposer decomposer,
                 MetricsTagger tagger,
                 TimeUnit rateUnit,
                 TimeUnit durationUnit,
                 MetricFilter filter) {
    super(registry, "hawkular-reporter", filter, rateUnit, durationUnit);

    this.prefix = prefix;
    this.clock = Clock.defaultClock();
    this.hawkularClient = hawkularClient;
    this.decomposer = decomposer;
    this.tagger = tagger;
}
项目:hawkular-metrics    文件:HawkularReporter.java   
HawkularReporter(MetricRegistry registry,
                 HawkularHttpClient hawkularClient,
                 Optional<String> prefix,
                 MetricsDecomposer decomposer,
                 MetricsTagger tagger,
                 TimeUnit rateUnit,
                 TimeUnit durationUnit,
                 MetricFilter filter) {
    super(registry, "hawkular-reporter", filter, rateUnit, durationUnit);

    this.prefix = prefix;
    this.clock = Clock.defaultClock();
    this.hawkularClient = hawkularClient;
    this.decomposer = decomposer;
    this.tagger = tagger;
}
项目:NeverwinterDP-Commons    文件:ServerLogMetricForwarderUnitTest.java   
@Test
public void testBasic() throws Exception {
  FileUtil.removeIfExist("build/ServerLogMetricPlugin", false);

  YaraServiceImpl yaraService = new YaraServiceImpl() ;
  server.getServiceRegistry().register(YaraService.newReflectiveBlockingService(yaraService));

  MetricRegistry server1 = createMetricRegistry("server1") ;
  MetricRegistry server2 = createMetricRegistry("server2") ;

  Random rand = new Random() ;
  for(int i = 0; i < 100000; i++) {
    long timestamp = Clock.defaultClock().getTick() ;

    server1.counter("counter").incr() ;
    server1.timer("timer").update(timestamp, rand.nextInt(1000)) ;

    server2.counter("counter").incr() ;
    server2.timer("timer").update(timestamp, rand.nextInt(1000)) ;
  }
  Thread.sleep(6000);
  new ClusterMetricPrinter().print(yaraService.getClusterMetricRegistry()); 
}
项目:wildfly-monitor    文件:StorageReporter.java   
private StorageReporter(MetricRegistry registry,
                        Locale locale,
                        Clock clock,
                        TimeZone timeZone,
                        TimeUnit rateUnit,
                        TimeUnit durationUnit,
                        MetricFilter filter, StorageAdapter storageAdapter) {
    super(registry, "storage-reporter", filter, rateUnit, durationUnit);
    this.locale = locale;
    this.clock = clock;
    this.storageAdapter = storageAdapter;
    this.dateFormat = DateFormat.getDateTimeInstance(DateFormat.SHORT,
            DateFormat.MEDIUM,
            locale);
    dateFormat.setTimeZone(timeZone);
}
项目:metrics-influxdb    文件:ReporterV08.java   
public ReporterV08(MetricRegistry registry,
        Influxdb influxdb,
        Clock clock,
        String prefix,
        TimeUnit rateUnit,
        TimeUnit durationUnit,
        MetricFilter filter,
        boolean skipIdleMetrics,
        ScheduledExecutorService executor) {
    super(registry, "influxdb-reporter", filter, rateUnit, durationUnit, executor);
    this.skipIdleMetrics = skipIdleMetrics;
    this.previousValues = new TreeMap<String, Long>();
    this.influxdb = influxdb;
    this.clock = clock;
    this.prefix = (prefix == null) ? "" : (prefix.trim() + ".");
}
项目:metrics-elasticsearch    文件:ElasticsearchReporter.java   
protected ElasticsearchReporter(MetricRegistry registry, Clock clock,
        String elasticsearchIndexPrefix, String timestampFieldName,
        String metricPrefix, TimeUnit rateUnit, TimeUnit durationUnit,
        MetricFilter filter) {
    super(registry, "elasticsearch-reporter", filter, rateUnit,
            durationUnit);
    this.clock = clock;
    this.metricPrefix = metricPrefix;
    this.timestampFieldName = timestampFieldName;

    if (elasticsearchIndexPrefix.endsWith("-")) {
        this.elasticsearchIndexPrefix = elasticsearchIndexPrefix;
    } else {
        this.elasticsearchIndexPrefix = elasticsearchIndexPrefix + "-";
    }
    jsonFactory = new JsonFactory();
}
项目:stagemonitor    文件:InfluxDbReporterTest.java   
@Before
public void setUp() throws Exception {
    httpClient = mock(HttpClient.class);
    Clock clock = mock(Clock.class);
    timestamp = System.currentTimeMillis();
    when(clock.getTime()).thenReturn(timestamp);
    final CorePlugin corePlugin = mock(CorePlugin.class);
    when(corePlugin.getInfluxDbUrl()).thenReturn(new URL("http://localhost:8086"));
    when(corePlugin.getInfluxDbDb()).thenReturn("stm");
    influxDbReporter = InfluxDbReporter.forRegistry(new Metric2Registry(), corePlugin)
            .convertRatesTo(TimeUnit.SECONDS)
            .convertDurationsTo(DURATION_UNIT)
            .globalTags(singletonMap("app", "test"))
            .httpClient(httpClient)
            .clock(clock)
            .build();
}
项目:grails-lightweight-deploy    文件:AsyncRequestLog.java   
public AsyncRequestLog(Clock clock,
                       AppenderAttachableImpl<ILoggingEvent> appenders,
                       final TimeZone timeZone,
                       List<String> cookies) {
    this.clock = clock;
    this.cookies = cookies;
    this.queue = new LinkedBlockingQueue<String>();
    this.dispatcher = new Dispatcher();
    this.dispatchThread = new Thread(dispatcher);
    dispatchThread.setName("async-request-log-dispatcher-" + THREAD_COUNTER.incrementAndGet());
    dispatchThread.setDaemon(true);

    this.dateCache = new ThreadLocal<DateCache>() {
        @Override
        protected DateCache initialValue() {
            final DateCache cache = new DateCache("dd/MMM/yyyy:HH:mm:ss Z", Locale.US);
            cache.setTimeZoneID(timeZone.getID());
            return cache;
        }
    };

    this.appenders = appenders;
}
项目:grails-lightweight-deploy    文件:ExternalConnectorFactory.java   
private AbstractConnector configureExternalHttpsConnector() {
    logger.info("Creating https connector");

    final SslContextFactory sslContextFactory = new SslContextFactory();
    sslContextFactory.setCertAlias(getConfiguration().getSslConfiguration().getKeyStoreAlias());
    sslContextFactory.setKeyStorePath(getConfiguration().getSslConfiguration().getKeyStorePath());
    sslContextFactory.setKeyStorePassword(getConfiguration().getSslConfiguration().getKeyStorePassword());

    final Integer port = getConfiguration().getSslConfiguration().getPort() != null ?
            getConfiguration().getSslConfiguration().getPort() :
            getConfiguration().getPort();

    final InstrumentedSslSocketConnector connector = new InstrumentedSslSocketConnector(
            this.metricRegistry,
            port,
            sslContextFactory,
            Clock.defaultClock());
    connector.setName(EXTERNAL_HTTPS_CONNECTOR_NAME);

    return connector;
}
项目:JInsight    文件:JedisRuleHelper.java   
public void onTransactionExec(Transaction tx) {
  Long startTime = removeObjectProperty(tx, TRANSACTION_START_TIME_PROP_NAME);
  if (startTime == null) {
    return;
  }

  long t = Clock.defaultClock().getTick() - startTime;
  txExecTimer.update(t, TimeUnit.NANOSECONDS);
}
项目:JInsight    文件:JedisRuleHelper.java   
public void onTransactionDiscard(Transaction tx) {
  Long startTime = removeObjectProperty(tx, TRANSACTION_START_TIME_PROP_NAME);
  if (startTime == null) {
    return;
  }
  long t = Clock.defaultClock().getTick() - startTime;
  txDiscardTimer.update(t, TimeUnit.NANOSECONDS);
}
项目:JInsight    文件:JedisRuleHelper.java   
public void onPipelineSync(Pipeline pipeline) {
  Long startTime = removeObjectProperty(pipeline, TRANSACTION_START_TIME_PROP_NAME);
  if (startTime == null) {
    return;
  }

  long t = Clock.defaultClock().getTick() - startTime;
  pipelineSyncTimer.update(t, TimeUnit.NANOSECONDS);
}
项目:oneops    文件:ElasticsearchReporter.java   
private Builder(MetricRegistry registry) {
    this.registry = registry;
    this.clock = Clock.defaultClock();
    this.prefix = null;
    this.rateUnit = TimeUnit.SECONDS;
    this.durationUnit = TimeUnit.MILLISECONDS;
    this.filter = MetricFilter.ALL;
}
项目:oneops    文件:ElasticsearchReporter.java   
public ElasticsearchReporter(MetricRegistry registry, String[] hosts, int timeout,
                             String index, String indexDateFormat, int bulkSize, Clock clock, String prefix, TimeUnit rateUnit, TimeUnit durationUnit,
                             MetricFilter filter, MetricFilter percolationFilter, Notifier percolationNotifier, String timestampFieldname,Map<String,String> context) throws MalformedURLException {
    super(registry, "elasticsearch-reporter", filter, rateUnit, durationUnit);
    this.hosts = hosts;
    this.index = index;
    this.bulkSize = bulkSize;
    this.clock = clock;
    this.prefix = prefix;
    this.timeout = timeout;
    if (indexDateFormat != null && indexDateFormat.length() > 0) {
        this.indexDateFormat = new SimpleDateFormat(indexDateFormat);
    }
    if (percolationNotifier != null && percolationFilter != null) {
        this.percolationFilter = percolationFilter;
        this.notifier = percolationNotifier;
    }
    if (timestampFieldname == null || timestampFieldname.trim().length() == 0) {
        LOGGER.error("Timestampfieldname {} is not valid, using default @timestamp", timestampFieldname);
        timestampFieldname = "@timestamp";
    }

    objectMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
    objectMapper.configure(SerializationFeature.CLOSE_CLOSEABLE, false);
    // auto closing means, that the objectmapper is closing after the first write call, which does not work for bulk requests
    objectMapper.configure(JsonGenerator.Feature.AUTO_CLOSE_JSON_CONTENT, false);
    objectMapper.configure(JsonGenerator.Feature.AUTO_CLOSE_TARGET, false);

    objectMapper.registerModule(new MetricsElasticsearchModule(rateUnit, durationUnit, timestampFieldname));
    writer = objectMapper.writer();
    checkForIndexTemplate();
}
项目:Lagerta    文件:HumanReadableCsvReporter.java   
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;
}
项目:Lagerta    文件:HumanReadableCsvReporter.java   
/** */
private HumanReadableCsvReporter(MetricRegistry registry, File directory, Locale locale, TimeUnit rateUnit,
    TimeUnit durationUnit, Clock clock, MetricFilter filter) {
    super(registry, "human-readable-csv-reporter", filter, rateUnit, durationUnit);
    this.directory = directory;
    this.locale = locale;
    this.clock = clock;
}
项目:semantic-metrics    文件:DelegatingDerivingMeterTest.java   
private void setupRateTest() throws InterruptedException {
    Clock clock = mock(Clock.class);

    meter = new DelegatingDerivingMeter(new Meter(clock));

    when(clock.getTick()).thenReturn(0L);
    meter.mark(0);
    meter.mark(2000);
    // need to 'wait' more than 5 seconds for the Codahale metrics meter to 'tick'.
    when(clock.getTick()).thenReturn(TimeUnit.NANOSECONDS.convert(6, TimeUnit.SECONDS));
}
项目:codahale-aggregated-metrics-cloudwatch-reporter    文件:CloudWatchReporter.java   
private Builder(final MetricRegistry metricRegistry, final AmazonCloudWatchAsync cloudWatchAsyncClient, final String namespace) {
    this.metricRegistry = metricRegistry;
    this.cloudWatchAsyncClient = cloudWatchAsyncClient;
    this.namespace = namespace;
    this.percentiles = new Percentile[]{Percentile.P75, Percentile.P95, Percentile.P999};
    this.metricFilter = MetricFilter.ALL;
    this.rateUnit = TimeUnit.SECONDS;
    this.durationUnit = TimeUnit.MILLISECONDS;
    this.globalDimensions = new LinkedHashSet<>();
    this.cwRateUnit = toStandardUnit(rateUnit);
    this.cwDurationUnit = toStandardUnit(durationUnit);
    this.clock = Clock.defaultClock();
}
项目:mongoose-base    文件:CustomMeter.java   
public CustomMeter(final Clock clock, final int periodSec) {
    final double ps = periodSec > 0 ? periodSec : 10;
    final int intervalSecs = 1;
    rateAvg = new EWMA(1 - exp(-intervalSecs / ps), intervalSecs, TimeUnit.SECONDS);
    this.clock = clock;
    startTime = clock.getTick();
    lastTick.set(startTime);
}
项目:monitoring-center    文件:CompositeForwardingTimer.java   
public CompositeForwardingTimer(Timer mainDelegate, MetricProvider<Timer> supplementaryMetricProvider) {
    Preconditions.checkNotNull(mainDelegate);
    Preconditions.checkNotNull(supplementaryMetricProvider);

    this.mainDelegate = mainDelegate;
    this.supplementaryMetricProvider = supplementaryMetricProvider;
    this.clock = Clock.defaultClock();
}
项目:metrics-circonus    文件:CirconusReporter.java   
private CirconusReporter(MetricRegistry metricRegistry,
                        Transport transport,
                        MetricFilter filter,
                        Clock clock,
                        String host,
                        EnumSet<Expansion> expansions,
                        TimeUnit rateUnit,
                        TimeUnit durationUnit,
                        MetricNameFormatter metricNameFormatter,
                        List<String> tags,
                        String prefix,
                        DynamicTagsCallback tagsCallback,
                        Boolean suppress) {
  super(metricRegistry, "circonus-reporter", filter, rateUnit, durationUnit);
  if(!(metricRegistry instanceof CirconusMetricRegistryAlaCoda)) {
    LOG.warn("CirconusReporter started without a  CirconusMetricRegistry(AlaCoda) so no real histograms.");
  }
  this.clock = clock;
  this.host = host;
  this.expansions = expansions;
  this.metricNameFormatter = metricNameFormatter;
  this.tags = (tags == null) ? new ArrayList<String>() : tags;
  this.transport = transport;
  this.prefix = prefix;
  this.tagsCallback = tagsCallback;
  this.suppress_bad_analytics = suppress;
}
项目:metrics-circonus    文件:CirconusReporter.java   
public Builder(MetricRegistry registry) {
  this.registry = registry;
  this.expansions = Expansion.ALL;
  this.clock = Clock.defaultClock();
  this.rateUnit = TimeUnit.SECONDS;
  this.durationUnit = TimeUnit.MILLISECONDS;
  this.filter = MetricFilter.ALL;
  this.metricNameFormatter = new DefaultMetricNameFormatter();
  this.tags = new ArrayList<String>();
  this.suppress_bad_analytics = true;
}
项目:Gobblin    文件:OutputStreamReporter.java   
protected 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.tags = new LinkedHashMap<String, String>();
}
项目:metrics-os    文件:OperatingSystemGaugeSet.java   
public OperatingSystemGaugeSet( OperatingSystemMXBean osMxBean,
                                int cacheTimeoutValue,
                                TimeUnit cacheTimeoutUnit,
                                Clock cacheTimeoutClock ) {
    this.osMxBean = osMxBean;
    this.cacheTimeoutValue = cacheTimeoutValue;
    this.cacheTimeoutUnit = cacheTimeoutUnit;
    this.cacheTimeoutClock = cacheTimeoutClock;
}
项目:metrics-os    文件:OperatingSystemInfo.java   
public OperatingSystemInfo( OperatingSystemMXBean osMxBean,
                            long timeout,
                            TimeUnit timeoutUnit,
                            Clock timeoutClock ) {
    super( Objects.requireNonNull( timeoutClock ), timeout, Objects.requireNonNull( timeoutUnit ) );
    this.osMxBean = Objects.requireNonNull( osMxBean );
}
项目:micro-server    文件:TestReporter.java   
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;
}
项目:micro-server    文件:TestReporter.java   
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;
}
项目:micro-server    文件:TestReporter.java   
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;
}
项目:carbon-metrics    文件:DasReporter.java   
private Builder(MetricRegistry registry) {
    this.registry = registry;
    this.rateUnit = TimeUnit.SECONDS;
    this.durationUnit = TimeUnit.MILLISECONDS;
    this.clock = Clock.defaultClock();
    this.filter = MetricFilter.ALL;
}
项目:carbon-metrics    文件:DasReporter.java   
private DasReporter(MetricRegistry registry, String source, String type, String receiverURL, String authURL,
                    String username, String password, String dataAgentConfigPath, TimeUnit rateUnit,
                    TimeUnit durationUnit, Clock clock, MetricFilter filter) {
    super(registry, "das-reporter", filter, rateUnit, durationUnit);
    this.source = source;
    this.clock = clock;
    if (source == null || source.trim().isEmpty()) {
        throw new IllegalArgumentException("Source cannot be null or empty");
    }
    if (type == null || type.trim().isEmpty()) {
        throw new IllegalArgumentException("Type cannot be null or empty");
    }
    if (receiverURL == null || receiverURL.trim().isEmpty()) {
        throw new IllegalArgumentException("Data Receiver URL cannot be null or empty");
    }
    if (username == null || username.trim().isEmpty()) {
        throw new IllegalArgumentException("Username cannot be null or empty");
    }
    if (password == null || password.trim().isEmpty()) {
        throw new IllegalArgumentException("Password cannot be null or empty");
    }
    if (dataAgentConfigPath != null) {
        AgentHolder.setConfigPath(dataAgentConfigPath);
    }
    try {
        dataPublisher = new DataPublisher(type, receiverURL, authURL, username, password);
    } catch (DataEndpointAgentConfigurationException | DataEndpointException | DataEndpointConfigurationException
            | DataEndpointAuthenticationException | TransportException e) {
        throw new IllegalStateException("Error when initializing the Data Publisher", e);
    }
}
项目:carbon-metrics    文件:JdbcReporter.java   
private Builder(MetricRegistry registry) {
    this.registry = registry;
    this.rateUnit = TimeUnit.SECONDS;
    this.durationUnit = TimeUnit.MILLISECONDS;
    this.clock = Clock.defaultClock();
    this.filter = MetricFilter.ALL;
    this.timestampUnit = TimeUnit.SECONDS;
}
项目:carbon-metrics    文件:JdbcReporter.java   
private JdbcReporter(MetricRegistry registry, String source, DataSource dataSource, TimeUnit rateUnit,
                     TimeUnit durationUnit, TimeUnit timestampUnit, Clock clock, MetricFilter filter) {
    super(registry, "jdbc-reporter", filter, rateUnit, durationUnit);
    this.source = source;
    this.dataSource = dataSource;
    this.timestampUnit = timestampUnit;
    this.clock = clock;
    if (source == null || source.trim().isEmpty()) {
        throw new IllegalArgumentException("Source cannot be null or empty");
    }
    if (dataSource == null) {
        throw new IllegalArgumentException("Data source cannot be null");
    }
}
项目:heroic    文件:MinMaxSlidingTimeReservoir.java   
/**
 * Build a new reservoir.
 *
 * @param clock Clock to use as a time source
 * @param size Number of buckets to maintain
 * @param step Step between each bucket
 * @param stepUnit Time unit used in 'step'
 * @param delegate Delegate reservoir that min/max is being corrected for.
 */
public MinMaxSlidingTimeReservoir(
    final Clock clock, final int size, final long step, final TimeUnit stepUnit,
    final Reservoir delegate
) {
    this.clock = clock;
    this.size = size;
    this.step = stepUnit.toNanos(step);
    this.delegate = delegate;
}
项目:ezbake-common-java    文件:MetricsReporter.java   
private Builder(MetricRegistry registry) {
    this.registry = registry;
    this.clock = Clock.defaultClock();
    this.filter = MetricFilter.ALL;
    this.rateUnit = TimeUnit.SECONDS;
    this.durationUnit = TimeUnit.MILLISECONDS; 
}
项目:datacollector    文件:ExtendedMeter.java   
public ExtendedMeter(Clock clock) {
  super(clock);
  this.clock = clock;
  this.lastTick = new AtomicLong(this.clock.getTick());
  m30Rate = new EWMA(M30_ALPHA, INTERVAL, TimeUnit.SECONDS);
  h1Rate = new EWMA(H1_ALPHA, INTERVAL, TimeUnit.SECONDS);
  h6Rate = new EWMA(H6_ALPHA, INTERVAL, TimeUnit.SECONDS);
  h12Rate = new EWMA(H12_ALPHA, INTERVAL, TimeUnit.SECONDS);
  h24Rate = new EWMA(H24_ALPHA, INTERVAL, TimeUnit.SECONDS);
}
项目:metrics-instrumental    文件:InstrumentalReporter.java   
private Builder(MetricRegistry registry) {
    this.registry = registry;
    this.clock = Clock.defaultClock();
    this.prefix = null;
    this.rateUnit = TimeUnit.SECONDS;
    this.durationUnit = TimeUnit.MILLISECONDS;
    this.filter = MetricFilter.ALL;
}