@Inject public GelfChunkAggregator(@Named("daemonScheduler") ScheduledExecutorService scheduler, MetricRegistry metricRegistry) { scheduler.scheduleAtFixedRate(new ChunkEvictionTask(), VALIDITY_PERIOD, CHECK_PERIOD, TimeUnit.MILLISECONDS); chunkCounter = metricRegistry.counter(CHUNK_COUNTER); // this is a counter instead of a Gauge, because calling sortedEvictionSet.size() is expensive waitingMessages = metricRegistry.counter(WAITING_MESSAGES); completeMessages = metricRegistry.counter(COMPLETE_MESSAGES); expiredMessages = metricRegistry.counter(EXPIRED_MESSAGES); expiredChunks = metricRegistry.counter(EXPIRED_CHUNKS); duplicateChunks = metricRegistry.counter(DUPLICATE_CHUNKS); }
public RequestMetrics(final String group, final String type, final String requestName, final MetricRegistry registry) { final String prefix = MetricRegistry.name(group, type, requestName); successCounter = registry.counter(prefix + "_successful"); failureCounter = registry.counter(prefix + "_failed"); userErrorCounter = registry.counter(prefix + "_failed"); timer = registry.timer(prefix + "_latency"); }
@Inject public Messages(MetricRegistry metricRegistry, JestClient client) { invalidTimestampMeter = metricRegistry.meter(name(Messages.class, "invalid-timestamps")); outputByteCounter = metricRegistry.counter(GlobalMetricNames.OUTPUT_TRAFFIC); systemTrafficCounter = metricRegistry.counter(GlobalMetricNames.SYSTEM_OUTPUT_TRAFFIC); this.client = client; // TODO: Magic number this.indexFailureQueue = new LinkedBlockingQueue<>(1000); }
@Inject public JournallingMessageHandler(MetricRegistry metrics, Journal journal, @Named("JournalSignal") Semaphore journalFilled) { this.journal = journal; this.journalFilled = journalFilled; byteCounter = metrics.counter(MetricRegistry.name(JournallingMessageHandler.class, "written_bytes")); }
public MasterRequestMetrics(String group, String type, String requestName, final MetricRegistry registry) { final String prefix = name(group, type, requestName); successCounter = registry.counter(prefix + "_count_success"); failureCounter = registry.counter(prefix + "_count_failures"); userErrorCounter = registry.counter(prefix + "_count_usererror"); successMeter = registry.meter(prefix + "_meter_success"); failureMeter = registry.meter(prefix + "_meter_failures"); userErrorMeter = registry.meter(prefix + "_meter_usererror"); }
@Inject public WidgetResultCache(MetricRegistry metricRegistry, WidgetStrategyFactory widgetStrategyFactory) { this.metricRegistry = metricRegistry; this.widgetStrategyFactory = widgetStrategyFactory; this.cache = Maps.newConcurrentMap(); this.counter = metricRegistry.counter(name(getClass(), "cacheEntries")); }
public ProducerInstrumentation(MetricRegistry registry, String baseMetricName) { super(baseMetricName); this.totalSent = registry.counter(name(baseMetricName, Producer.TOTAL_SENT)); this.totalSentFailures = registry .counter(name(baseMetricName, Producer.TOTAL_SENT_FAILURES)); this.sentPerSecond = registry .meter(name(baseMetricName, Producer.SENT_PER_SECOND)); this.sentFailuresPerSecond = registry .meter(name(baseMetricName, Producer.SENT_FAILURES_PER_SECOND)); }
public ConsumerInstrumentation(MetricRegistry registry, String baseMetricName) { super(baseMetricName); this.totalConsumed = registry .counter(name(baseMetricName, Consumer.TOTAL_CONSUMED)); this.consumedPerSecond = registry .meter(name(baseMetricName, Consumer.CONSUMED_PER_SECOND)); this.totalConsumedFailures = registry .counter(name(baseMetricName, Consumer.TOTAL_CONSUMED_FAILURES)); this.consumedFailuresPerSecond = registry .meter(name(baseMetricName, Consumer.CONSUMED_FAILURES_PER_SECOND)); }
@Inject public DnsLookupDataAdapter(@Assisted("id") String id, @Assisted("name") String name, @Assisted LookupDataAdapterConfiguration config, MetricRegistry metricRegistry) { super(id, name, config, metricRegistry); this.config = (Config) config; this.errorCounter = metricRegistry.counter(MetricRegistry.name(getClass(), id, ERROR_COUNTER)); this.resolveDomainNameTimer = metricRegistry.timer(MetricRegistry.name(getClass(), id, TIMER_RESOLVE_DOMAIN_NAME)); this.reverseLookupTimer = metricRegistry.timer(MetricRegistry.name(getClass(), id, TIMER_REVERSE_LOOKUP)); this.textLookupTimer = metricRegistry.timer(MetricRegistry.name(getClass(), id, TIMER_TEXT_LOOKUP)); }
public RunnerStats(MetricRegistry registry) { this.normalRunners = registry.counter( name(MetricsConnection.class, "normalRunnersCount")); this.delayRunners = registry.counter( name(MetricsConnection.class, "delayRunnersCount")); this.delayIntevalHist = registry.histogram( name(MetricsConnection.class, "delayIntervalHist")); }
public TimerImpl(String timerName, MetricRegistry metricRegistry){ this.timerName = timerName; this.metricRegistry = metricRegistry; this.successfulCallsTimer = metricRegistry.timer(name(timerName, SUCCESSFUL)); this.totalCallsCounter = metricRegistry.counter(name(timerName, TOTAL)); this.failedCallsCounter = metricRegistry.counter(name(timerName, FAILED)); this.metrics = new TimerMetrics(); }
@Inject public JournalReader(Journal journal, ProcessBuffer processBuffer, @Named("JournalSignal") Semaphore journalFilled, MetricRegistry metricRegistry, EventBus eventBus) { this.journal = journal; this.processBuffer = processBuffer; this.journalFilled = journalFilled; this.metricRegistry = metricRegistry; this.eventBus = eventBus; shouldBeReading = false; readBlocked = metricRegistry.counter(name(this.getClass(), "readBlocked")); readMessages = metricRegistry.meter(name(this.getClass(), "readMessages")); }
public static Counter counter(String name, String topologyId, String componentId, Integer taskId, Integer workerPort, String streamId) { String metricName = metricName(name, topologyId, componentId, streamId, taskId, workerPort); return REGISTRY.counter(metricName); }
/** * @param name the name of the metric * @return a counter object with the qualified metric name */ public static Counter counter(String name) { return METRIC_REGISTRY.counter(getMetricName(name)); }
public Counter getCounter(String prefix, String... names) { return getRegistry().counter(MetricRegistry.name(prefix, names)); }
public Counter getCounter(String name) { return getRegistry().counter(name); }
@AssistedInject public DecodingProcessor(Map<String, Codec.Factory<? extends Codec>> codecFactory, final ServerStatus serverStatus, final MetricRegistry metricRegistry, final Journal journal, @Assisted("decodeTime") Timer decodeTime, @Assisted("parseTime") Timer parseTime) { this.codecFactory = codecFactory; this.serverStatus = serverStatus; this.metricRegistry = metricRegistry; this.journal = journal; // these metrics are global to all processors, thus they are passed in directly to avoid relying on the class name this.parseTime = parseTime; this.decodeTime = decodeTime; decodedTrafficCounter = metricRegistry.counter(GlobalMetricNames.DECODED_TRAFFIC); }
public Counter registerCounter(String name) { return StormMetricRegistry.registry().counter(metricName(name)); }
public static Counter counter(String name, WorkerTopologyContext context, String componentId, Integer taskId, String streamId) { String metricName = metricName(name, context.getStormId(), componentId, streamId, taskId, context.getThisWorkerPort()); return REGISTRY.counter(metricName); }