test_class.declarator: COUNTER_REGISTRY =
              ConnectivityCounterRegistry.fromConfig(TestConstants.MONITORING_CONFIG.counter())
test_class.modifier: private static final
test_class.original_string: private static final ConnectivityCounterRegistry COUNTER_REGISTRY =
              ConnectivityCounterRegistry.fromConfig(TestConstants.MONITORING_CONFIG.counter());
test_class.type: ConnectivityCounterRegistry
test_class.var_name: COUNTER_REGISTRY
test_class.declarator: CONNECTION_ID = TestConstants.createRandomConnectionId()
test_class.modifier: private static final
test_class.original_string: private static final ConnectionId CONNECTION_ID = TestConstants.createRandomConnectionId();
test_class.type: ConnectionId
test_class.var_name: CONNECTION_ID
test_class.declarator: SOURCE = "source1"
test_class.modifier: private static final
test_class.original_string: private static final String SOURCE = "source1";
test_class.type: String
test_class.var_name: SOURCE
test_class.declarator: TARGET = "target1"
test_class.modifier: private static final
test_class.original_string: private static final String TARGET = "target1";
test_class.type: String
test_class.var_name: TARGET
test_class.declarator: FIXED_INSTANT = Instant.now().truncatedTo(ChronoUnit.MILLIS)
test_class.modifier: private static final
test_class.original_string: private static final Instant FIXED_INSTANT = Instant.now().truncatedTo(ChronoUnit.MILLIS);
test_class.type: Instant
test_class.var_name: FIXED_INSTANT
test_class.declarator: FIXED_CLOCK = Clock.fixed(FIXED_INSTANT, ZoneId.systemDefault())
test_class.modifier: private static final
test_class.original_string: private static final Clock FIXED_CLOCK = Clock.fixed(FIXED_INSTANT, ZoneId.systemDefault());
test_class.type: Clock
test_class.var_name: FIXED_CLOCK
test_class.file: services/connectivity/messaging/src/test/java/org/eclipse/ditto/services/connectivity/messaging/monitoring/metrics/ConnectivityCounterRegistryTest.java
test_class.identifier: ConnectivityCounterRegistryTest
test_case.body: @Test
      public void testAggregateSourceMetrics() {
  
          final SourceMetrics sourceMetrics = COUNTER_REGISTRY.aggregateSourceMetrics(CONNECTION_ID);
  
          final Measurement[] expected = {
                  getMeasurement(MAPPED, true),
                  getMeasurement(MAPPED, false),
                  getMeasurement(CONSUMED, true),
                  getMeasurement(CONSUMED, false)
          };
  
          assertThat(sourceMetrics.getAddressMetrics().get(SOURCE).getMeasurements()).containsExactlyInAnyOrder(expected);
  
      }
test_case.class_method_signature: ConnectivityCounterRegistryTest.testAggregateSourceMetrics()
test_case.full_signature: @Test public void testAggregateSourceMetrics()
test_case.identifier: testAggregateSourceMetrics
test_case.invocations: aggregateSourceMetrics getMeasurement getMeasurement getMeasurement getMeasurement containsExactlyInAnyOrder assertThat getMeasurements get getAddressMetrics
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testAggregateSourceMetrics()
focal_class.declarator: counters = new ConcurrentHashMap<>()
focal_class.modifier: private static final
focal_class.original_string: private static final ConcurrentMap<MapKey, DefaultConnectionMetricsCounter> counters = new ConcurrentHashMap<>();
focal_class.type: ConcurrentMap<MapKey, DefaultConnectionMetricsCounter>
focal_class.var_name: counters
focal_class.declarator: DEFAULT_WINDOWS = {ONE_MINUTE, ONE_HOUR, ONE_DAY}
focal_class.modifier: private static final
focal_class.original_string: private static final MeasurementWindow[] DEFAULT_WINDOWS = {ONE_MINUTE, ONE_HOUR, ONE_DAY};
focal_class.type: MeasurementWindow[]
focal_class.var_name: DEFAULT_WINDOWS
focal_class.declarator: RESPONSES_ADDRESS = "_responses"
focal_class.modifier: private static final
focal_class.original_string: private static final String RESPONSES_ADDRESS = "_responses";
focal_class.type: String
focal_class.var_name: RESPONSES_ADDRESS
focal_class.declarator: CLOCK_UTC = Clock.systemUTC()
focal_class.modifier: private static final
focal_class.original_string: private static final Clock CLOCK_UTC = Clock.systemUTC();
focal_class.type: Clock
focal_class.var_name: CLOCK_UTC
focal_class.file: services/connectivity/messaging/src/main/java/org/eclipse/ditto/services/connectivity/messaging/monitoring/metrics/ConnectivityCounterRegistry.java
focal_class.identifier: ConnectivityCounterRegistry
focal_class.interfaces: implements ConnectionMonitorRegistry<ConnectionMetricsCounter>
focal_class.class_method_signature: ConnectivityCounterRegistry.ConnectivityCounterRegistry()
focal_class.full_signature: private  ConnectivityCounterRegistry()
focal_class.identifier: ConnectivityCounterRegistry
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.signature:  ConnectivityCounterRegistry()
focal_class.class_method_signature: ConnectivityCounterRegistry.fromConfig(final MonitoringCounterConfig config)
focal_class.full_signature: public static ConnectivityCounterRegistry fromConfig(final MonitoringCounterConfig config)
focal_class.identifier: fromConfig
focal_class.modifiers: public static
focal_class.parameters: (final MonitoringCounterConfig config)
focal_class.return: ConnectivityCounterRegistry
focal_class.signature: ConnectivityCounterRegistry fromConfig(final MonitoringCounterConfig config)
focal_class.class_method_signature: ConnectivityCounterRegistry.initForConnection(final Connection connection)
focal_class.full_signature: @Override public void initForConnection(final Connection connection)
focal_class.identifier: initForConnection
focal_class.modifiers: @Override public
focal_class.parameters: (final Connection connection)
focal_class.return: void
focal_class.signature: void initForConnection(final Connection connection)
focal_class.class_method_signature: ConnectivityCounterRegistry.resetForConnection(final Connection connection)
focal_class.full_signature: @Override public void resetForConnection(final Connection connection)
focal_class.identifier: resetForConnection
focal_class.modifiers: @Override public
focal_class.parameters: (final Connection connection)
focal_class.return: void
focal_class.signature: void resetForConnection(final Connection connection)
focal_class.class_method_signature: ConnectivityCounterRegistry.initCounter(final ConnectionId connectionId, final MetricDirection metricDirection,
              final String address)
focal_class.full_signature: private static void initCounter(final ConnectionId connectionId, final MetricDirection metricDirection,
              final String address)
focal_class.identifier: initCounter
focal_class.modifiers: private static
focal_class.parameters: (final ConnectionId connectionId, final MetricDirection metricDirection,
              final String address)
focal_class.return: void
focal_class.signature: void initCounter(final ConnectionId connectionId, final MetricDirection metricDirection,
              final String address)
focal_class.class_method_signature: ConnectivityCounterRegistry.getCounter(
              final ConnectionId connectionId,
              final MetricType metricType,
              final MetricDirection metricDirection,
              final String address)
focal_class.full_signature: public ConnectionMetricsCounter getCounter(
              final ConnectionId connectionId,
              final MetricType metricType,
              final MetricDirection metricDirection,
              final String address)
focal_class.identifier: getCounter
focal_class.modifiers: public
focal_class.parameters: (
              final ConnectionId connectionId,
              final MetricType metricType,
              final MetricDirection metricDirection,
              final String address)
focal_class.return: ConnectionMetricsCounter
focal_class.signature: ConnectionMetricsCounter getCounter(
              final ConnectionId connectionId,
              final MetricType metricType,
              final MetricDirection metricDirection,
              final String address)
focal_class.class_method_signature: ConnectivityCounterRegistry.getCounter(
              final Clock clock,
              final ConnectionId connectionId,
              final MetricType metricType,
              final MetricDirection metricDirection,
              final String address)
focal_class.full_signature:  ConnectionMetricsCounter getCounter(
              final Clock clock,
              final ConnectionId connectionId,
              final MetricType metricType,
              final MetricDirection metricDirection,
              final String address)
focal_class.identifier: getCounter
focal_class.parameters: (
              final Clock clock,
              final ConnectionId connectionId,
              final MetricType metricType,
              final MetricDirection metricDirection,
              final String address)
focal_class.return: ConnectionMetricsCounter
focal_class.signature: ConnectionMetricsCounter getCounter(
              final Clock clock,
              final ConnectionId connectionId,
              final MetricType metricType,
              final MetricDirection metricDirection,
              final String address)
focal_class.class_method_signature: ConnectivityCounterRegistry.forOutboundDispatched(final ConnectionId connectionId, final String target)
focal_class.full_signature: @Override public ConnectionMetricsCounter forOutboundDispatched(final ConnectionId connectionId, final String target)
focal_class.identifier: forOutboundDispatched
focal_class.modifiers: @Override public
focal_class.parameters: (final ConnectionId connectionId, final String target)
focal_class.return: ConnectionMetricsCounter
focal_class.signature: ConnectionMetricsCounter forOutboundDispatched(final ConnectionId connectionId, final String target)
focal_class.class_method_signature: ConnectivityCounterRegistry.forOutboundAcknowledged(final ConnectionId connectionId, final String target)
focal_class.full_signature: @Override public ConnectionMetricsCounter forOutboundAcknowledged(final ConnectionId connectionId, final String target)
focal_class.identifier: forOutboundAcknowledged
focal_class.modifiers: @Override public
focal_class.parameters: (final ConnectionId connectionId, final String target)
focal_class.return: ConnectionMetricsCounter
focal_class.signature: ConnectionMetricsCounter forOutboundAcknowledged(final ConnectionId connectionId, final String target)
focal_class.class_method_signature: ConnectivityCounterRegistry.forOutboundFiltered(final ConnectionId connectionId, final String target)
focal_class.full_signature: @Override public ConnectionMetricsCounter forOutboundFiltered(final ConnectionId connectionId, final String target)
focal_class.identifier: forOutboundFiltered
focal_class.modifiers: @Override public
focal_class.parameters: (final ConnectionId connectionId, final String target)
focal_class.return: ConnectionMetricsCounter
focal_class.signature: ConnectionMetricsCounter forOutboundFiltered(final ConnectionId connectionId, final String target)
focal_class.class_method_signature: ConnectivityCounterRegistry.forOutboundPublished(final ConnectionId connectionId, final String target)
focal_class.full_signature: @Override public ConnectionMetricsCounter forOutboundPublished(final ConnectionId connectionId, final String target)
focal_class.identifier: forOutboundPublished
focal_class.modifiers: @Override public
focal_class.parameters: (final ConnectionId connectionId, final String target)
focal_class.return: ConnectionMetricsCounter
focal_class.signature: ConnectionMetricsCounter forOutboundPublished(final ConnectionId connectionId, final String target)
focal_class.class_method_signature: ConnectivityCounterRegistry.forInboundConsumed(final ConnectionId connectionId, final String source)
focal_class.full_signature: @Override public ConnectionMetricsCounter forInboundConsumed(final ConnectionId connectionId, final String source)
focal_class.identifier: forInboundConsumed
focal_class.modifiers: @Override public
focal_class.parameters: (final ConnectionId connectionId, final String source)
focal_class.return: ConnectionMetricsCounter
focal_class.signature: ConnectionMetricsCounter forInboundConsumed(final ConnectionId connectionId, final String source)
focal_class.class_method_signature: ConnectivityCounterRegistry.forInboundAcknowledged(final ConnectionId connectionId, final String source)
focal_class.full_signature: @Override public ConnectionMetricsCounter forInboundAcknowledged(final ConnectionId connectionId, final String source)
focal_class.identifier: forInboundAcknowledged
focal_class.modifiers: @Override public
focal_class.parameters: (final ConnectionId connectionId, final String source)
focal_class.return: ConnectionMetricsCounter
focal_class.signature: ConnectionMetricsCounter forInboundAcknowledged(final ConnectionId connectionId, final String source)
focal_class.class_method_signature: ConnectivityCounterRegistry.forInboundMapped(final ConnectionId connectionId, final String source)
focal_class.full_signature: @Override public ConnectionMetricsCounter forInboundMapped(final ConnectionId connectionId, final String source)
focal_class.identifier: forInboundMapped
focal_class.modifiers: @Override public
focal_class.parameters: (final ConnectionId connectionId, final String source)
focal_class.return: ConnectionMetricsCounter
focal_class.signature: ConnectionMetricsCounter forInboundMapped(final ConnectionId connectionId, final String source)
focal_class.class_method_signature: ConnectivityCounterRegistry.forInboundEnforced(final ConnectionId connectionId, final String source)
focal_class.full_signature: @Override public ConnectionMetricsCounter forInboundEnforced(final ConnectionId connectionId, final String source)
focal_class.identifier: forInboundEnforced
focal_class.modifiers: @Override public
focal_class.parameters: (final ConnectionId connectionId, final String source)
focal_class.return: ConnectionMetricsCounter
focal_class.signature: ConnectionMetricsCounter forInboundEnforced(final ConnectionId connectionId, final String source)
focal_class.class_method_signature: ConnectivityCounterRegistry.forInboundDropped(final ConnectionId connectionId, final String source)
focal_class.full_signature: @Override public ConnectionMetricsCounter forInboundDropped(final ConnectionId connectionId, final String source)
focal_class.identifier: forInboundDropped
focal_class.modifiers: @Override public
focal_class.parameters: (final ConnectionId connectionId, final String source)
focal_class.return: ConnectionMetricsCounter
focal_class.signature: ConnectionMetricsCounter forInboundDropped(final ConnectionId connectionId, final String source)
focal_class.class_method_signature: ConnectivityCounterRegistry.forResponseDispatched(final ConnectionId connectionId)
focal_class.full_signature: @Override public ConnectionMetricsCounter forResponseDispatched(final ConnectionId connectionId)
focal_class.identifier: forResponseDispatched
focal_class.modifiers: @Override public
focal_class.parameters: (final ConnectionId connectionId)
focal_class.return: ConnectionMetricsCounter
focal_class.signature: ConnectionMetricsCounter forResponseDispatched(final ConnectionId connectionId)
focal_class.class_method_signature: ConnectivityCounterRegistry.forResponseDropped(final ConnectionId connectionId)
focal_class.full_signature: @Override public ConnectionMetricsCounter forResponseDropped(final ConnectionId connectionId)
focal_class.identifier: forResponseDropped
focal_class.modifiers: @Override public
focal_class.parameters: (final ConnectionId connectionId)
focal_class.return: ConnectionMetricsCounter
focal_class.signature: ConnectionMetricsCounter forResponseDropped(final ConnectionId connectionId)
focal_class.class_method_signature: ConnectivityCounterRegistry.forResponseMapped(final ConnectionId connectionId)
focal_class.full_signature: @Override public ConnectionMetricsCounter forResponseMapped(final ConnectionId connectionId)
focal_class.identifier: forResponseMapped
focal_class.modifiers: @Override public
focal_class.parameters: (final ConnectionId connectionId)
focal_class.return: ConnectionMetricsCounter
focal_class.signature: ConnectionMetricsCounter forResponseMapped(final ConnectionId connectionId)
focal_class.class_method_signature: ConnectivityCounterRegistry.forResponsePublished(final ConnectionId connectionId)
focal_class.full_signature: @Override public ConnectionMetricsCounter forResponsePublished(final ConnectionId connectionId)
focal_class.identifier: forResponsePublished
focal_class.modifiers: @Override public
focal_class.parameters: (final ConnectionId connectionId)
focal_class.return: ConnectionMetricsCounter
focal_class.signature: ConnectionMetricsCounter forResponsePublished(final ConnectionId connectionId)
focal_class.class_method_signature: ConnectivityCounterRegistry.streamFor(final ConnectionId connectionId,
              final MetricDirection metricDirection)
focal_class.full_signature: private static Stream<DefaultConnectionMetricsCounter> streamFor(final ConnectionId connectionId,
              final MetricDirection metricDirection)
focal_class.identifier: streamFor
focal_class.modifiers: private static
focal_class.parameters: (final ConnectionId connectionId,
              final MetricDirection metricDirection)
focal_class.return: Stream<DefaultConnectionMetricsCounter>
focal_class.signature: Stream<DefaultConnectionMetricsCounter> streamFor(final ConnectionId connectionId,
              final MetricDirection metricDirection)
focal_class.class_method_signature: ConnectivityCounterRegistry.aggregateMetrics(final ConnectionId connectionId,
              final MetricDirection metricDirection)
focal_class.full_signature: private static Map<String, AddressMetric> aggregateMetrics(final ConnectionId connectionId,
              final MetricDirection metricDirection)
focal_class.identifier: aggregateMetrics
focal_class.modifiers: private static
focal_class.parameters: (final ConnectionId connectionId,
              final MetricDirection metricDirection)
focal_class.return: Map<String, AddressMetric>
focal_class.signature: Map<String, AddressMetric> aggregateMetrics(final ConnectionId connectionId,
              final MetricDirection metricDirection)
focal_class.class_method_signature: ConnectivityCounterRegistry.aggregateSourceMetrics(final ConnectionId connectionId)
focal_class.full_signature: public SourceMetrics aggregateSourceMetrics(final ConnectionId connectionId)
focal_class.identifier: aggregateSourceMetrics
focal_class.modifiers: public
focal_class.parameters: (final ConnectionId connectionId)
focal_class.return: SourceMetrics
focal_class.signature: SourceMetrics aggregateSourceMetrics(final ConnectionId connectionId)
focal_class.class_method_signature: ConnectivityCounterRegistry.aggregateTargetMetrics(final ConnectionId connectionId)
focal_class.full_signature: public TargetMetrics aggregateTargetMetrics(final ConnectionId connectionId)
focal_class.identifier: aggregateTargetMetrics
focal_class.modifiers: public
focal_class.parameters: (final ConnectionId connectionId)
focal_class.return: TargetMetrics
focal_class.signature: TargetMetrics aggregateTargetMetrics(final ConnectionId connectionId)
focal_class.class_method_signature: ConnectivityCounterRegistry.mergeRetrieveConnectionMetricsResponse(
              final RetrieveConnectionMetricsResponse first,
              final RetrieveConnectionMetricsResponse second)
focal_class.full_signature: public static RetrieveConnectionMetricsResponse mergeRetrieveConnectionMetricsResponse(
              final RetrieveConnectionMetricsResponse first,
              final RetrieveConnectionMetricsResponse second)
focal_class.identifier: mergeRetrieveConnectionMetricsResponse
focal_class.modifiers: public static
focal_class.parameters: (
              final RetrieveConnectionMetricsResponse first,
              final RetrieveConnectionMetricsResponse second)
focal_class.return: RetrieveConnectionMetricsResponse
focal_class.signature: RetrieveConnectionMetricsResponse mergeRetrieveConnectionMetricsResponse(
              final RetrieveConnectionMetricsResponse first,
              final RetrieveConnectionMetricsResponse second)
focal_class.class_method_signature: ConnectivityCounterRegistry.aggregateConnectionMetrics(
              final SourceMetrics sourceMetrics, final TargetMetrics targetMetrics)
focal_class.full_signature: public ConnectionMetrics aggregateConnectionMetrics(
              final SourceMetrics sourceMetrics, final TargetMetrics targetMetrics)
focal_class.identifier: aggregateConnectionMetrics
focal_class.modifiers: public
focal_class.parameters: (
              final SourceMetrics sourceMetrics, final TargetMetrics targetMetrics)
focal_class.return: ConnectionMetrics
focal_class.signature: ConnectionMetrics aggregateConnectionMetrics(
              final SourceMetrics sourceMetrics, final TargetMetrics targetMetrics)
focal_class.class_method_signature: ConnectivityCounterRegistry.mergeAllMetrics(final Collection<AddressMetric> metrics)
focal_class.full_signature: private static AddressMetric mergeAllMetrics(final Collection<AddressMetric> metrics)
focal_class.identifier: mergeAllMetrics
focal_class.modifiers: private static
focal_class.parameters: (final Collection<AddressMetric> metrics)
focal_class.return: AddressMetric
focal_class.signature: AddressMetric mergeAllMetrics(final Collection<AddressMetric> metrics)
focal_class.class_method_signature: ConnectivityCounterRegistry.mergeAddressMetric(final AddressMetric first, final AddressMetric second)
focal_class.full_signature: public static AddressMetric mergeAddressMetric(final AddressMetric first, final AddressMetric second)
focal_class.identifier: mergeAddressMetric
focal_class.modifiers: public static
focal_class.parameters: (final AddressMetric first, final AddressMetric second)
focal_class.return: AddressMetric
focal_class.signature: AddressMetric mergeAddressMetric(final AddressMetric first, final AddressMetric second)
focal_class.class_method_signature: ConnectivityCounterRegistry.mergeAddressMetricMap(final Map<String, AddressMetric> first,
              final Map<String, AddressMetric> second)
focal_class.full_signature: public static Map<String, AddressMetric> mergeAddressMetricMap(final Map<String, AddressMetric> first,
              final Map<String, AddressMetric> second)
focal_class.identifier: mergeAddressMetricMap
focal_class.modifiers: public static
focal_class.parameters: (final Map<String, AddressMetric> first,
              final Map<String, AddressMetric> second)
focal_class.return: Map<String, AddressMetric>
focal_class.signature: Map<String, AddressMetric> mergeAddressMetricMap(final Map<String, AddressMetric> first,
              final Map<String, AddressMetric> second)
focal_class.class_method_signature: ConnectivityCounterRegistry.asMap(final AddressMetric a)
focal_class.full_signature: private static Map<String, Measurement> asMap(final AddressMetric a)
focal_class.identifier: asMap
focal_class.modifiers: private static
focal_class.parameters: (final AddressMetric a)
focal_class.return: Map<String, Measurement>
focal_class.signature: Map<String, Measurement> asMap(final AddressMetric a)
focal_class.class_method_signature: ConnectivityCounterRegistry.mergeMeasurements(final Map<Duration, Long> measurementA,
              final Map<Duration, Long> measurementB)
focal_class.full_signature: private static Map<Duration, Long> mergeMeasurements(final Map<Duration, Long> measurementA,
              final Map<Duration, Long> measurementB)
focal_class.identifier: mergeMeasurements
focal_class.modifiers: private static
focal_class.parameters: (final Map<Duration, Long> measurementA,
              final Map<Duration, Long> measurementB)
focal_class.return: Map<Duration, Long>
focal_class.signature: Map<Duration, Long> mergeMeasurements(final Map<Duration, Long> measurementA,
              final Map<Duration, Long> measurementB)
focal_class.class_method_signature: ConnectivityCounterRegistry.latest(@Nullable final Instant instantA, @Nullable final Instant instantB)
focal_class.full_signature: @Nullable private static Instant latest(@Nullable final Instant instantA, @Nullable final Instant instantB)
focal_class.identifier: latest
focal_class.modifiers: @Nullable private static
focal_class.parameters: (@Nullable final Instant instantA, @Nullable final Instant instantB)
focal_class.return: Instant
focal_class.signature: Instant latest(@Nullable final Instant instantA, @Nullable final Instant instantB)
focal_method.body: public SourceMetrics aggregateSourceMetrics(final ConnectionId connectionId) {
          return ConnectivityModelFactory.newSourceMetrics(aggregateMetrics(connectionId, MetricDirection.INBOUND));
      }
focal_method.class_method_signature: ConnectivityCounterRegistry.aggregateSourceMetrics(final ConnectionId connectionId)
focal_method.full_signature: public SourceMetrics aggregateSourceMetrics(final ConnectionId connectionId)
focal_method.identifier: aggregateSourceMetrics
focal_method.invocations: newSourceMetrics aggregateMetrics
focal_method.modifiers: public
focal_method.parameters: (final ConnectionId connectionId)
focal_method.return: SourceMetrics
focal_method.signature: SourceMetrics aggregateSourceMetrics(final ConnectionId connectionId)