@Test public void getInitial() { HubSubscriptionMetrics metric = testSubject.get("myComponent", "myContext"); assertEquals(0, (long) metric.activesCount()); }
public HubSubscriptionMetrics get(String componentName, String context) { AtomicInteger active = activeSubscriptionsMetric(componentName, context); Counter total = totalSubscriptionsMetric(componentName, context); Counter updates = updatesMetric(componentName, context); return new HubSubscriptionMetrics( Tags.of(MeterFactory.CONTEXT, context, TAG_COMPONENT, componentName), new CounterMetric(activeSubscriptionsMetricName(componentName, context), () -> (long) active.get()), new CounterMetric(total.getId().getName(), () -> (long) total.count()), new CounterMetric(updates.getId().getName(), () -> (long) updates.count()), clusterMetricProvider); }
ApplicationSubscriptionMetricRegistry { public HubSubscriptionMetrics get(String componentName, String context) { AtomicInteger active = activeSubscriptionsMetric(componentName, context); Counter total = totalSubscriptionsMetric(componentName, context); Counter updates = updatesMetric(componentName, context); return new HubSubscriptionMetrics( Tags.of(MeterFactory.CONTEXT, context, TAG_COMPONENT, componentName), new CounterMetric(activeSubscriptionsMetricName(componentName, context), () -> (long) active.get()), new CounterMetric(total.getId().getName(), () -> (long) total.count()), new CounterMetric(updates.getId().getName(), () -> (long) updates.count()), clusterMetricProvider); } }
ApplicationSubscriptionMetricRegistry { public HubSubscriptionMetrics get(String componentName, String context) { AtomicInteger active = activeSubscriptionsMetric(componentName, context); Counter total = totalSubscriptionsMetric(componentName, context); Counter updates = updatesMetric(componentName, context); return new HubSubscriptionMetrics( Tags.of(MeterFactory.CONTEXT, context, TAG_COMPONENT, componentName), new CounterMetric(activeSubscriptionsMetricName(componentName, context), () -> (long) active.get()), new CounterMetric(total.getId().getName(), () -> (long) total.count()), new CounterMetric(updates.getId().getName(), () -> (long) updates.count()), clusterMetricProvider); } ApplicationSubscriptionMetricRegistry(MeterFactory localMetricRegistry,
                                                 BiFunction<String, Tags, ClusterMetric> clusterMetricProvider); }
ApplicationSubscriptionMetricRegistry { public HubSubscriptionMetrics get(String componentName, String context) { AtomicInteger active = activeSubscriptionsMetric(componentName, context); Counter total = totalSubscriptionsMetric(componentName, context); Counter updates = updatesMetric(componentName, context); return new HubSubscriptionMetrics( Tags.of(MeterFactory.CONTEXT, context, TAG_COMPONENT, componentName), new CounterMetric(activeSubscriptionsMetricName(componentName, context), () -> (long) active.get()), new CounterMetric(total.getId().getName(), () -> (long) total.count()), new CounterMetric(updates.getId().getName(), () -> (long) updates.count()), clusterMetricProvider); } ApplicationSubscriptionMetricRegistry(MeterFactory localMetricRegistry,
                                                 BiFunction<String, Tags, ClusterMetric> clusterMetricProvider); HubSubscriptionMetrics get(String componentName, String context); @EventListener void on(SubscriptionQueryEvents.SubscriptionQueryRequested event); @EventListener void on(SubscriptionQueryEvents.SubscriptionQueryCanceled event); @EventListener void on(SubscriptionQueryEvents.SubscriptionQueryResponseReceived event); }
ApplicationSubscriptionMetricRegistry { public HubSubscriptionMetrics get(String componentName, String context) { AtomicInteger active = activeSubscriptionsMetric(componentName, context); Counter total = totalSubscriptionsMetric(componentName, context); Counter updates = updatesMetric(componentName, context); return new HubSubscriptionMetrics( Tags.of(MeterFactory.CONTEXT, context, TAG_COMPONENT, componentName), new CounterMetric(activeSubscriptionsMetricName(componentName, context), () -> (long) active.get()), new CounterMetric(total.getId().getName(), () -> (long) total.count()), new CounterMetric(updates.getId().getName(), () -> (long) updates.count()), clusterMetricProvider); } ApplicationSubscriptionMetricRegistry(MeterFactory localMetricRegistry,
                                                 BiFunction<String, Tags, ClusterMetric> clusterMetricProvider); HubSubscriptionMetrics get(String componentName, String context); @EventListener void on(SubscriptionQueryEvents.SubscriptionQueryRequested event); @EventListener void on(SubscriptionQueryEvents.SubscriptionQueryCanceled event); @EventListener void on(SubscriptionQueryEvents.SubscriptionQueryResponseReceived event);  }