Enable percentile histograms in metrics

To allow more precise graphing.

Change-Id: I3c498b24c01e599eec316f552e25d06d653a08bb
Issue-ID: DCAEGEN2-1107
Signed-off-by: Filip Krzywka <filip.krzywka@nokia.com>
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 b832bc9..fd1d9c5 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
@@ -21,6 +21,7 @@
 
 import arrow.syntax.function.memoize
 import io.micrometer.core.instrument.Counter
+import io.micrometer.core.instrument.Timer
 import io.micrometer.core.instrument.binder.jvm.ClassLoaderMetrics
 import io.micrometer.core.instrument.binder.jvm.JvmGcMetrics
 import io.micrometer.core.instrument.binder.jvm.JvmMemoryMetrics
@@ -53,8 +54,12 @@
     private val totalConnections = registry.counter(name(CONNECTIONS))
     private val disconnections = registry.counter(name(DISCONNECTIONS))
 
-    private val processingTime = registry.timer(name(MESSAGES, PROCESSING, TIME))
-    private val totalLatency = registry.timer(name(MESSAGES, LATENCY))
+    private val processingTime = Timer.builder(name(MESSAGES, PROCESSING, TIME))
+            .publishPercentileHistogram(true)
+            .register(registry)
+    private val totalLatency = Timer.builder(name(MESSAGES, LATENCY))
+            .publishPercentileHistogram(true)
+            .register(registry)
 
     private val sentMessages = registry.counter(name(MESSAGES, SENT))
     private val sentMessagesByTopic = { topic: String ->