public double getBufferTotalBytes() { return getDoubleValue(LEADER_CONFIRMS_BUFFER_TOTAL_BYTES) + getDoubleValue(EVERYONE_CONFIRMS_BUFFER_TOTAL_BYTES); }
public InstrumentedExecutorService(ExecutorService delegate, HermesMetrics hermesMetrics, String name) { this.delegate = delegate; this.submitted = hermesMetrics.executorSubmittedMeter(name); this.running = hermesMetrics.executorRunningCounter(name); this.completed = hermesMetrics.executorCompletedMeter(name); this.duration = hermesMetrics.executorDurationTimer(name); this.waiting = hermesMetrics.executorWaitingTimer(name); }
public InstrumentedScheduledExecutorService(ScheduledExecutorService delegate, HermesMetrics hermesMetrics, String name) { super(delegate, hermesMetrics, name); this.delegate = delegate; this.scheduledOverrun = hermesMetrics.scheduledExecutorOverrun(name); }
MaxRateCalculator(SubscriptionAssignmentCache subscriptionAssignmentCache, SubscriptionsCache subscriptionsCache, MaxRateBalancer balancer, MaxRateRegistry maxRateRegistry, HermesMetrics metrics, Clock clock) { this.subscriptionAssignmentCache = subscriptionAssignmentCache; this.subscriptionsCache = subscriptionsCache; this.balancer = balancer; this.maxRateRegistry = maxRateRegistry; this.metrics = metrics; this.clock = clock; metrics.registerGauge(Gauges.MAX_RATE_CALCULATION_DURATION, () -> lastUpdateDurationMillis); }
public void shutdown() { maxRateSupervisor.unregister(this); metrics.unregisterMaxRateGauge(subscription); metrics.unregisterRateGauge(subscription); } }
public void start() { maxRateSupervisor.register(this); metrics.registerMaxRateGauge(subscription, this::get); metrics.registerRateGauge(subscription, sendCounters::getRate); }
private boolean isBufferEmpty() { long bufferUsedBytes = (long)(metrics.getBufferTotalBytes() - metrics.getBufferAvailablesBytes()); logger.info("Buffer flush: {} bytes still in use", bufferUsedBytes); return bufferUsedBytes < TOLERANCE_BYTES; }
public Meter meter(String metric) { return metricRegistry.meter(metricRegistryName(metric)); }
public HermesShutdownHandler(HttpHandler next, HermesMetrics metrics) { this.next = next; this.metrics = metrics; metrics.registerProducerInflightRequest(() -> inflightRequests.get()); }
public void decrementInflightCounter(Subscription subscription) { getInflightCounter(subscription).dec(); }
MaxRateCalculator(SubscriptionAssignmentCache subscriptionAssignmentCache, SubscriptionsCache subscriptionsCache, MaxRateBalancer balancer, MaxRateRegistry maxRateRegistry, HermesMetrics metrics, Clock clock) { this.subscriptionAssignmentCache = subscriptionAssignmentCache; this.subscriptionsCache = subscriptionsCache; this.balancer = balancer; this.maxRateRegistry = maxRateRegistry; this.metrics = metrics; this.clock = clock; metrics.registerGauge(Gauges.MAX_RATE_CALCULATION_DURATION, () -> lastUpdateDurationMillis); }
public void shutdown() { maxRateSupervisor.unregister(this); metrics.unregisterMaxRateGauge(subscription); metrics.unregisterRateGauge(subscription); } }
public Counter counter(String metric, TopicName topicName) { return metricRegistry.counter(metricRegistryName(metric, topicName)); }
public double getBufferAvailablesBytes() { return getDoubleValue(LEADER_CONFIRMS_BUFFER_AVAILABLE_BYTES) + getDoubleValue(EVERYONE_CONFIRMS_BUFFER_AVAILABLE_BYTES); }
public ConsumersRuntimeMonitor(ConsumersSupervisor consumerSupervisor, SupervisorController workloadSupervisor, HermesMetrics hermesMetrics, SubscriptionsCache subscriptionsCache, ConfigFactory configFactory) { this.consumerSupervisor = consumerSupervisor; this.workloadSupervisor = workloadSupervisor; this.subscriptionsCache = subscriptionsCache; this.scanIntervalSeconds = configFactory.getIntProperty(Configs.CONSUMER_WORKLOAD_MONITOR_SCAN_INTERVAL); hermesMetrics.registerGauge("consumers-workload.monitor.running", () -> monitorMetrics.running); hermesMetrics.registerGauge("consumers-workload.monitor.assigned", () -> monitorMetrics.assigned); hermesMetrics.registerGauge("consumers-workload.monitor.missing", () -> monitorMetrics.missing); hermesMetrics.registerGauge("consumers-workload.monitor.oversubscribed", () -> monitorMetrics.oversubscribed); }
public void registerProducerInflightRequest(Gauge<Integer> gauge) { metricRegistry.register(metricRegistryName(Gauges.INFLIGHT_REQUESTS), gauge); }
public ByteBufferMessageBatchFactory(int poolableSize, int maxPoolSize, Clock clock, HermesMetrics hermesMetrics) { this.clock = clock; this.bufferPool = new DirectBufferPool(maxPoolSize, poolableSize, true); hermesMetrics.registerGauge(Gauges.BATCH_BUFFER_TOTAL_BYTES, bufferPool::totalMemory); hermesMetrics.registerGauge(Gauges.BATCH_BUFFER_AVAILABLE_BYTES, bufferPool::availableMemory); }
public MonitoredMpscQueue(HermesMetrics metrics, String name, int capacity) { this.queue = new MpscArrayQueue<>(capacity); this.name = name; this.metrics = metrics; metrics.registerGauge("queue." + name + ".utilization", () -> queue.size() / queue.capacity()); }
public MonitoredMpscQueue(HermesMetrics metrics, String name, int capacity) { this.queue = new MpscArrayQueue<>(capacity); this.name = name; this.metrics = metrics; metrics.registerGauge("queue." + name + ".utilization", () -> queue.size() / queue.capacity()); }