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); }
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 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 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 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 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); }
private void registerGauge(Producer<byte[], byte[]> producer, HermesMetrics metrics, String gauge, Predicate<Map.Entry<MetricName, ? extends Metric>> predicate) { metrics.registerGauge(gauge, () -> { Optional<? extends Map.Entry<MetricName, ? extends Metric>> first = producer.metrics().entrySet().stream().filter(predicate).findFirst(); double value = first.isPresent() ? first.get().getValue().value() : 0.0; return value < 0? 0.0 : value; }); }
this.intervalSeconds = intervalSeconds; metrics.registerGauge( gaugeName(kafkaCluster, "selective.all-assignments"), () -> balancingMetrics.allAssignments ); metrics.registerGauge( gaugeName(kafkaCluster, "selective.missing-resources"), () -> balancingMetrics.missingResources ); metrics.registerGauge( gaugeName(kafkaCluster, ".selective.deleted-assignments"), () -> balancingMetrics.deletedAssignments ); metrics.registerGauge( gaugeName(kafkaCluster, ".selective.created-assignments"), () -> balancingMetrics.createdAssignments
this.intervalSeconds = intervalSeconds; metrics.registerGauge( gaugeName(kafkaCluster, "selective.all-assignments"), () -> balancingMetrics.allAssignments ); metrics.registerGauge( gaugeName(kafkaCluster, "selective.missing-resources"), () -> balancingMetrics.missingResources ); metrics.registerGauge( gaugeName(kafkaCluster, ".selective.deleted-assignments"), () -> balancingMetrics.deletedAssignments ); metrics.registerGauge( gaugeName(kafkaCluster, ".selective.created-assignments"), () -> balancingMetrics.createdAssignments
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()); }