本文整理匯總了Java中com.codahale.metrics.MetricRegistry.meter方法的典型用法代碼示例。如果您正苦於以下問題:Java MetricRegistry.meter方法的具體用法?Java MetricRegistry.meter怎麽用?Java MetricRegistry.meter使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.codahale.metrics.MetricRegistry
的用法示例。
在下文中一共展示了MetricRegistry.meter方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: AnomalyDetector
import com.codahale.metrics.MetricRegistry; //導入方法依賴的package包/類
public AnomalyDetector(KafkaCruiseControlConfig config,
LoadMonitor loadMonitor,
KafkaCruiseControl kafkaCruiseControl,
Time time,
MetricRegistry dropwizardMetricRegistry) {
_anomalies = new LinkedBlockingDeque<>();
_anomalyDetectionIntervalMs = config.getLong(KafkaCruiseControlConfig.ANOMALY_DETECTION_INTERVAL_MS_CONFIG);
_anomalyNotifier = config.getConfiguredInstance(KafkaCruiseControlConfig.ANOMALY_NOTIFIER_CLASS_CONFIG,
AnomalyNotifier.class);
_goalViolationDetector = new GoalViolationDetector(config, loadMonitor, _anomalies, time);
_brokerFailureDetector = new BrokerFailureDetector(config, loadMonitor, _anomalies, time);
_kafkaCruiseControl = kafkaCruiseControl;
_detectorScheduler =
Executors.newScheduledThreadPool(3, new KafkaCruiseControlThreadFactory("AnomalyDetector", false, LOG));
_shutdown = false;
_brokerFailureRate = dropwizardMetricRegistry.meter(MetricRegistry.name("AnomalyDetector", "broker-failure-rate"));
_goalViolationRate = dropwizardMetricRegistry.meter(MetricRegistry.name("AnomalyDetector", "goal-violation-rate"));
}
示例2: configureMetrics
import com.codahale.metrics.MetricRegistry; //導入方法依賴的package包/類
private void configureMetrics(MetricRegistry metrics) {
saveNamespaceTimer = metrics.timer(MetricRegistry.name(DefaultGroupService.class,
"saveNamespaceTimer"));
saveOwnerTimer = metrics.timer(MetricRegistry.name(DefaultGroupService.class,
"saveOwnerTimer"));
saveServiceTimer = metrics.timer(MetricRegistry.name(DefaultGroupService.class,
"saveServiceTimer"));
saveMemberTimer = metrics.timer(MetricRegistry.name(DefaultGroupService.class,
"saveMemberTimer"));
readNamespaceTimer = metrics.timer(MetricRegistry.name(DefaultGroupService.class,
"readNamespaceTimer"));
removeRelationTimer = metrics.timer(MetricRegistry.name(DefaultGroupService.class,
"removeRelationTimer"));
readCacheTimer = metrics.timer(MetricRegistry.name(DefaultGroupService.class,
"readCacheTimer"));
addToCacheTimer = metrics.timer(MetricRegistry.name(DefaultGroupService.class,
"addToCacheTimer"));
loadCacheMissMeter = metrics.meter(MetricRegistry.name(DefaultGroupService.class,
"loadCacheMissMeter"));
loadCacheHitMeter = metrics.meter(MetricRegistry.name(DefaultGroupService.class,
"loadCacheHitMeter"));
}
示例3: DynamoDbCommand
import com.codahale.metrics.MetricRegistry; //導入方法依賴的package包/類
public DynamoDbCommand(
String commandName,
Supplier<R> storageAction,
Supplier<R> fallbackAction,
HystrixConfiguration hystrixConfiguration,
MetricRegistry metrics
) {
super(hystrixConfiguration.getHystrixCommandSetter());
this.commandName = commandName;
this.storageAction = storageAction;
this.fallbackAction = fallbackAction;
this.timer = metrics.timer(MetricRegistry.name(this.getClass(), commandName + ".timer"));
this.meter = metrics.meter(MetricRegistry.name(this.getClass(), commandName + ".meter"));
this.failMeter =
metrics.meter(MetricRegistry.name(this.getClass(), commandName + ".failMeter"));
this.throughputFailMeter =
metrics.meter(MetricRegistry.name(this.getClass(), commandName + ".throughputFailMeter"));
}
示例4: configureMetrics
import com.codahale.metrics.MetricRegistry; //導入方法依賴的package包/類
private void configureMetrics(MetricRegistry metrics) {
saveFeatureTimer = metrics.timer(MetricRegistry.name(DefaultFeatureService.class,
"saveFeatureTimer"));
updateFeatureTimer = metrics.timer(MetricRegistry.name(DefaultFeatureService.class,
"updateFeatureTimer"));
addToCacheTimer = metrics.timer(MetricRegistry.name(DefaultFeatureService.class,
"addToCacheTimer"));
loadFeaturesTimer = metrics.timer(MetricRegistry.name(DefaultFeatureService.class,
"loadFeaturesTimer"));
loadFeaturesCacheTimer = metrics.timer(MetricRegistry.name(DefaultFeatureService.class,
"loadFeaturesCacheTimer"));
loadFeaturesCacheHitMeter = metrics.meter(MetricRegistry.name(DefaultFeatureService.class,
"loadFeaturesCacheHitMeter"));
loadFeaturesCacheMissMeter = metrics.meter(MetricRegistry.name(DefaultFeatureService.class,
"loadFeaturesCacheMissMeter"));
loadFeatureByKeyTimer = metrics.timer(MetricRegistry.name(DefaultFeatureService.class,
"loadFeatureByKeyTimer"));
loadFeatureCacheTimer = metrics.timer(MetricRegistry.name(DefaultFeatureService.class,
"loadFeatureCacheTimer"));
loadFeatureCacheHitMeter = metrics.meter(MetricRegistry.name(DefaultFeatureService.class,
"loadFeatureCacheHitMeter"));
loadFeatureCacheMissMeter = metrics.meter(MetricRegistry.name(DefaultFeatureService.class,
"loadFeatureCacheMissMeter"));
}
示例5: RedisCacheCommand
import com.codahale.metrics.MetricRegistry; //導入方法依賴的package包/類
public RedisCacheCommand(
String commandName,
Supplier<T> cacheAction,
Supplier<T> fallbackAction,
HystrixConfiguration hystrixConfiguration,
MetricRegistry metrics
) {
super(hystrixConfiguration.getHystrixCommandSetter());
this.commandName = commandName;
this.cacheAction = cacheAction;
this.fallbackAction = fallbackAction;
this.timer = metrics.timer(MetricRegistry.name(this.getClass(), commandName + ".timer"));
this.meter = metrics.meter(MetricRegistry.name(this.getClass(), commandName + ".meter"));
this.failMeter =
metrics.meter(MetricRegistry.name(this.getClass(), commandName + ".failMeter"));
}
示例6: PGFactStore
import com.codahale.metrics.MetricRegistry; //導入方法依賴的package包/類
@Autowired
public PGFactStore(JdbcTemplate jdbcTemplate, PGSubscriptionFactory subscriptionFactory,
MetricRegistry registry) {
this.jdbcTemplate = jdbcTemplate;
this.subscriptionFactory = subscriptionFactory;
this.registry = registry;
publishFailedCounter = registry.counter(names.factPublishingFailed());
publishLatency = registry.timer(names.factPublishingLatency());
publishMeter = registry.meter(names.factPublishingMeter());
fetchLatency = registry.timer(names.fetchLatency());
seqLookupLatency = registry.timer(names.seqLookupLatency());
subscriptionCatchupMeter = registry.meter(names.subscribeCatchup());
subscriptionFollowMeter = registry.meter(names.subscribeFollow());
}
示例7: MineboxExport
import com.codahale.metrics.MetricRegistry; //導入方法依賴的package包/類
@Inject
public MineboxExport(MinebdConfig config, MetricRegistry metrics, BucketFactory bucketFactory) {
this.config = config;
files = createFilesCache(config);
this.bucketSize = config.bucketSize.toBytes();
read = metrics.meter("readBytes");
write = metrics.meter("writeBytes");
this.bucketFactory = bucketFactory;
metrics.gauge("openfiles", () -> files::size);
}
示例8: MessageBuffer
import com.codahale.metrics.MetricRegistry; //導入方法依賴的package包/類
@Inject
public MessageBuffer(MessageBufferConfiguration config, MetricRegistry metricRegistry) {
this.metricRegistry = metricRegistry;
this.queue = Queues.newLinkedBlockingQueue(config.getSize());
this.inserted = metricRegistry.meter(name(getClass(), "inserted"));
this.removed = metricRegistry.meter(name(getClass(), "removed"));
}
示例9: MetricHandler
import com.codahale.metrics.MetricRegistry; //導入方法依賴的package包/類
/**
* Constructor
*
* @param store
* Metric store
*/
public MetricHandler(@Nonnull final MetricStore store) {
this.store = Objects.requireNonNull(store);
final MetricRegistry registry = SharedMetricRegistries
.getOrCreate("default");
this.metricMeter = registry
.meter(MetricRegistry.name(MetricHandler.class, "metric-rate"));
}
示例10: FeatureStoreMetered
import com.codahale.metrics.MetricRegistry; //導入方法依賴的package包/類
FeatureStoreMetered(FeatureStore featureStore, MetricsContext metricsContext) {
this.featureStore = featureStore;
MetricRegistry metrics = metricsContext.metrics();
String context = metricsContext.context();
this.putTimer = metrics.timer(MetricRegistry.name(
context + "." + METRICS_PATH, "putTimer"));
this.putMeter = metrics.meter(MetricRegistry.name(
context + "." + METRICS_PATH, "putMeter"));
this.findTimer = metrics.timer(MetricRegistry.name(
metricsContext + "." + METRICS_PATH, "findTimer"));
this.findMeter = metrics.meter(MetricRegistry.name(
context + "." + METRICS_PATH, "findMeter"));
this.findAllTimer = metrics.timer(MetricRegistry.name(
context + "." + METRICS_PATH, "findAllTimer"));
this.findAllMeter = metrics.meter(MetricRegistry.name(
context + "." + METRICS_PATH, "findAllMeter"));
this.flushTimer = metrics.timer(MetricRegistry.name(
context + "." + METRICS_PATH, "flushTimer"));
this.flushMeter = metrics.meter(MetricRegistry.name(
context + "." + METRICS_PATH, "flushMeter"));
this.flushAllTimer = metrics.timer(MetricRegistry.name(
context + "." + METRICS_PATH, "flushAllTimer"));
this.flushAllMeter = metrics.meter(MetricRegistry.name(
context + "." + METRICS_PATH, "flushAllMeter"));
}
示例11: ExceptionMeterMetric
import com.codahale.metrics.MetricRegistry; //導入方法依賴的package包/類
public ExceptionMeterMetric(final MetricRegistry registry, final Method method,
final ExceptionMetered exceptionMetered) {
final String name = chooseName(exceptionMetered.name(), exceptionMetered.absolute(), method,
ExceptionMetered.DEFAULT_NAME_SUFFIX);
this.meter = registry.meter(name);
this.cause = exceptionMetered.cause();
}
示例12: MonitoredExecutorService
import com.codahale.metrics.MetricRegistry; //導入方法依賴的package包/類
public MonitoredExecutorService(ExecutorService delegate, MetricRegistry registry, String
name) {
this.delegate = delegate;
this.submitted = registry.meter(MetricRegistry.name(name, "submitted"));
this.rejected = registry.meter(MetricRegistry.name(name, "rejected"));
this.running = registry.counter(MetricRegistry.name(name, "running"));
this.completed = registry.meter(MetricRegistry.name(name, "completed"));
this.dispatchDurationTimer = registry.timer(MetricRegistry.name(name, "dispatchDuration"));
this.durationTimer = registry.timer(MetricRegistry.name(name, "duration"));
}
示例13: Firewall
import com.codahale.metrics.MetricRegistry; //導入方法依賴的package包/類
public Firewall(MetricRegistry metrics) {
this.metrics = metrics;
this.rateLimits = metrics.meter("Hard Rate Limits");
}
示例14: FeatureStoreRocksDb
import com.codahale.metrics.MetricRegistry; //導入方法依賴的package包/類
FeatureStoreRocksDb(MetricsContext metricsContext, File dbPath) {
MetricRegistry metrics = metricsContext.metrics();
String context = metricsContext.context();
putTimer = metrics.timer(MetricRegistry.name(
context + "." + METRICS_PATH, "putTimer"));
putMeter = metrics.meter(MetricRegistry.name(
context + "." + METRICS_PATH, "putMeter"));
this.loadAllTimer = metrics.timer(MetricRegistry.name(
context + "." + METRICS_PATH, "loadAllTimer"));
this.loadAllMeter = metrics.meter(MetricRegistry.name(
context + "." + METRICS_PATH, "loadAllMeter"));
this.findAllTimer = metrics.timer(MetricRegistry.name(
context + "." + METRICS_PATH, "findAllTimer"));
this.findAllMeter = metrics.meter(MetricRegistry.name(
context + "." + METRICS_PATH, "findAllMeter"));
BlockBasedTableConfig tableConfig = new BlockBasedTableConfig();
tableConfig.setBlockCacheSize(BLOCK_CACHE_SIZE);
tableConfig.setBlockSize(BLOCK_SIZE);
options = new Options();
options.setTableFormatConfig(tableConfig);
options.setWriteBufferSize(WRITE_BUFFER_SIZE);
options.setCompressionType(COMPRESSION_TYPE);
options.setCompactionStyle(COMPACTION_STYLE);
options.setMaxWriteBufferNumber(MAX_WRITE_BUFFER_NUMBER);
options.setCreateIfMissing(CREATE_IF_MISSING);
options.setErrorIfExists(ERROR_IF_EXISTS);
writeOptions = new WriteOptions();
writeOptions.setDisableWAL(DISABLE_WAL);
writeOptions.setSync(true);
readOptions = new ReadOptions();
readOptions.setVerifyChecksums(true);
readOptions.setFillCache(true);
flushOptions = new FlushOptions();
flushOptions.setWaitForFlush(WAIT_FOR_FLUSH);
final File parent = new File("/tmp", "outland");
rocksDir = new File(dbPath, "feature-store");
//noinspection ResultOfMethodCallIgnored
rocksDir.getParentFile().mkdirs();
rocks = initializeRocksDb(); // todo: move this out?
}
示例15: InvalidCredentialsExceptionMapper
import com.codahale.metrics.MetricRegistry; //導入方法依賴的package包/類
public InvalidCredentialsExceptionMapper(MetricRegistry metrics) {
exceptions = metrics.meter(getClass().getCanonicalName() + " exceptions");
}