diff options
author | kjaniak <kornel.janiak@nokia.com> | 2019-11-07 12:29:12 +0100 |
---|---|---|
committer | kjaniak <kornel.janiak@nokia.com> | 2019-11-07 12:33:59 +0100 |
commit | 4f24529aef0b32ed7e3a721b805fa5de20b82d3d (patch) | |
tree | e87d9b1cc70a60d1cd3f6b8ae133496e95ead663 /sources/hv-collector-main | |
parent | 9a9e0107ffc5e04ffd16a313b66ea5835dc08169 (diff) |
Fix for 30s bucket problem in metrics
Change-Id: I9a6b362f59a47454cb36d9a54861d1bcc1b934be
Issue-ID: DCAEGEN2-1890
Signed-off-by: kjaniak <kornel.janiak@nokia.com>
Diffstat (limited to 'sources/hv-collector-main')
-rw-r--r-- | sources/hv-collector-main/src/main/kotlin/org/onap/dcae/collectors/veshv/main/metrics/MicrometerMetrics.kt | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sources/hv-collector-main/src/main/kotlin/org/onap/dcae/collectors/veshv/main/metrics/MicrometerMetrics.kt b/sources/hv-collector-main/src/main/kotlin/org/onap/dcae/collectors/veshv/main/metrics/MicrometerMetrics.kt index 9d417a28..2f3470a4 100644 --- a/sources/hv-collector-main/src/main/kotlin/org/onap/dcae/collectors/veshv/main/metrics/MicrometerMetrics.kt +++ b/sources/hv-collector-main/src/main/kotlin/org/onap/dcae/collectors/veshv/main/metrics/MicrometerMetrics.kt @@ -59,6 +59,7 @@ class MicrometerMetrics internal constructor( .publishPercentileHistogram(true) .register(registry) private val processingTimeWithoutRouting = Timer.builder(name(MESSAGES, PROCESSING, TIME, WITHOUT, ROUTING)) + .maximumExpectedValue(MAX_BUCKET_DURATION) .publishPercentileHistogram(true) .register(registry) private val totalLatency = Timer.builder(name(MESSAGES, LATENCY)) @@ -135,7 +136,7 @@ class MicrometerMetrics internal constructor( } companion object { - val INSTANCE = MicrometerMetrics() + val INSTANCE by lazy { MicrometerMetrics() } internal const val PREFIX = "hvves" internal const val MESSAGES = "messages" internal const val RECEIVED = "received" @@ -154,9 +155,9 @@ class MicrometerMetrics internal constructor( internal const val TIME = "time" internal const val LATENCY = "latency" internal const val PAYLOAD = "payload" - internal val MAX_BUCKET_DURATION = Duration.ofSeconds(300L) internal const val WITHOUT = "without" internal const val ROUTING = "routing" + internal val MAX_BUCKET_DURATION = Duration.ofSeconds(300L) internal fun name(vararg name: String) = "$PREFIX.${name.joinToString(".")}" } } |