diff options
author | Julien Fontaine <julien.fontaine@bell.ca> | 2021-02-05 14:18:06 -0500 |
---|---|---|
committer | Julien Fontaine <julien.fontaine@bell.ca> | 2021-02-11 16:14:30 -0500 |
commit | de13d783a07dbe7f64d377256be465486c65309b (patch) | |
tree | 7dd100839e4c06696c6ce8f6799956964d434939 /ms/blueprintsprocessor/functions/message-prioritization | |
parent | 136e3e19a1821a694d799e7c8d670407720c9e66 (diff) |
Added Kafka metrics for CDS workers
Added counters to gather metrics on CDS Kafka workers.
This will enable us to get metrics on how many messages we consumer and produce to/from kafka.
For consumers we count how many messages we consume and how many failed ie. consumed but not able to be processed (parsing error).
For producers we count how many messages we produce and how many failed ie. failed to be pushed to the cluster (unavailable brokers, network error, ...).
Relocated metrics tag constants to BlueprintConstants so that they can be use by any CDS module.
If they make sense for other metrics then they should be shared.
Issue-ID: CCSDK-3155
Signed-off-by: Julien Fontaine <julien.fontaine@bell.ca>
Change-Id: Iad6aba588766f655f3a74cd626e0f74e29188f96
Diffstat (limited to 'ms/blueprintsprocessor/functions/message-prioritization')
-rw-r--r-- | ms/blueprintsprocessor/functions/message-prioritization/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/message/prioritization/MessagePrioritizationConsumerTest.kt | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ms/blueprintsprocessor/functions/message-prioritization/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/message/prioritization/MessagePrioritizationConsumerTest.kt b/ms/blueprintsprocessor/functions/message-prioritization/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/message/prioritization/MessagePrioritizationConsumerTest.kt index 5f51394ca..9f74daa50 100644 --- a/ms/blueprintsprocessor/functions/message-prioritization/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/message/prioritization/MessagePrioritizationConsumerTest.kt +++ b/ms/blueprintsprocessor/functions/message-prioritization/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/message/prioritization/MessagePrioritizationConsumerTest.kt @@ -1,5 +1,6 @@ /* * Copyright © 2018-2019 AT&T Intellectual Property. + * Modifications Copyright © 2021 Bell Canada. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,6 +17,7 @@ package org.onap.ccsdk.cds.blueprintsprocessor.functions.message.prioritization +import io.micrometer.core.instrument.MeterRegistry import io.mockk.coEvery import io.mockk.every import io.mockk.mockk @@ -49,6 +51,7 @@ import org.onap.ccsdk.cds.controllerblueprints.core.logger import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintDependencyService import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest +import org.springframework.boot.test.mock.mockito.MockBean import org.springframework.context.ApplicationContext import org.springframework.test.annotation.DirtiesContext import org.springframework.test.context.ContextConfiguration @@ -120,6 +123,9 @@ open class MessagePrioritizationConsumerTest { @Autowired lateinit var messagePrioritizationStateService: MessagePrioritizationStateService + @MockBean + lateinit var meterRegistry: MeterRegistry + @Before fun setup() { BlueprintDependencyService.inject(applicationContext) |