本文整理汇总了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"));
}
示例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"));
}
示例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"));
}
示例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"));
}