当前位置: 首页>>代码示例>>Java>>正文


Java SharedMetricRegistries.getDefault方法代码示例

本文整理汇总了Java中com.codahale.metrics.SharedMetricRegistries.getDefault方法的典型用法代码示例。如果您正苦于以下问题:Java SharedMetricRegistries.getDefault方法的具体用法?Java SharedMetricRegistries.getDefault怎么用?Java SharedMetricRegistries.getDefault使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.codahale.metrics.SharedMetricRegistries的用法示例。


在下文中一共展示了SharedMetricRegistries.getDefault方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: S3ProgressListener

import com.codahale.metrics.SharedMetricRegistries; //导入方法依赖的package包/类
/**
 * Constructor
 *
 * @param key
 *            S3 key
 * @param start
 *            Start time in nanoseconds
 * @param count
 *            Number of events in the upload
 * @param size
 *            Size of the upload
 */
public S3ProgressListener(@Nonnull final String key, final long start,
        final int count, final int size) {
    this.key = Objects.requireNonNull(key);
    this.start = start;
    this.count = count;
    this.size = size;

    final MetricRegistry registry = SharedMetricRegistries.getDefault();
    this.uploadTime = registry
            .timer(name(S3ProgressListener.class, "upload-time"));
    this.successCounter = registry
            .counter(name(S3ProgressListener.class, "upload-success"));
    this.failedCounter = registry
            .counter(name(S3ProgressListener.class, "upload-failed"));
}
 
开发者ID:smoketurner,项目名称:uploader,代码行数:28,代码来源:S3ProgressListener.java

示例2: BatchHandler

import com.codahale.metrics.SharedMetricRegistries; //导入方法依赖的package包/类
/**
 * Constructor
 *
 * @param maxUploadBytes
 *            Maximum size of AWS S3 file to upload
 */
public BatchHandler(final long maxUploadBytes) {
    this.maxUploadBytes = maxUploadBytes;

    final MetricRegistry registry = SharedMetricRegistries.getDefault();
    this.eventMeter = registry
            .meter(MetricRegistry.name(BatchHandler.class, "event-rate"));
}
 
开发者ID:smoketurner,项目名称:uploader,代码行数:14,代码来源:BatchHandler.java

示例3: UploadHandler

import com.codahale.metrics.SharedMetricRegistries; //导入方法依赖的package包/类
/**
 * Constructor
 *
 * @param uploader
 *            AWS S3 uploader
 */
public UploadHandler(@Nonnull final Uploader uploader) {
    this.uploader = Objects.requireNonNull(uploader);

    final MetricRegistry registry = SharedMetricRegistries.getDefault();
    this.batchMeter = registry
            .meter(MetricRegistry.name(UploadHandler.class, "batch-rate"));
}
 
开发者ID:smoketurner,项目名称:uploader,代码行数:14,代码来源:UploadHandler.java

示例4: Uploader

import com.codahale.metrics.SharedMetricRegistries; //导入方法依赖的package包/类
/**
 * Constructor
 *
 * @param configuration
 *            AWS configuration
 */
public Uploader(@Nonnull final AwsConfiguration configuration) {
    this.configuration = Objects.requireNonNull(configuration);

    final MetricRegistry registry = SharedMetricRegistries.getDefault();

    this.batchSize = registry.histogram(name(Uploader.class, "batch-size"));
    this.batchCount = registry
            .histogram(name(Uploader.class, "batch-count"));
}
 
开发者ID:smoketurner,项目名称:uploader,代码行数:16,代码来源:Uploader.java


注:本文中的com.codahale.metrics.SharedMetricRegistries.getDefault方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。