summaryrefslogtreecommitdiffstats
path: root/sources/hv-collector-ct
diff options
context:
space:
mode:
authorkjaniak <kornel.janiak@nokia.com>2019-10-30 14:19:27 +0100
committerkjaniak <kornel.janiak@nokia.com>2019-10-30 14:43:00 +0100
commitcc4b14c46ea8796383be180bcafaea4575b96979 (patch)
tree393fd695bd8415ec2bcea7d222ad887b9d6860ce /sources/hv-collector-ct
parentb7547fedbaad693c9c1133f18cce1b8b5f9ff6e0 (diff)
Add metric for processing without routing
Performance tests need better check of processing time in HV-VES. Change-Id: I0792c4ac014a7b8907ef314a3fd9981776dc0b35 Issue-ID: DCAEGEN2-1890 Signed-off-by: kjaniak <kornel.janiak@nokia.com>
Diffstat (limited to 'sources/hv-collector-ct')
-rw-r--r--sources/hv-collector-ct/src/test/kotlin/org/onap/dcae/collectors/veshv/tests/fakes/metrics.kt6
1 files changed, 6 insertions, 0 deletions
diff --git a/sources/hv-collector-ct/src/test/kotlin/org/onap/dcae/collectors/veshv/tests/fakes/metrics.kt b/sources/hv-collector-ct/src/test/kotlin/org/onap/dcae/collectors/veshv/tests/fakes/metrics.kt
index a450b794..3b01d137 100644
--- a/sources/hv-collector-ct/src/test/kotlin/org/onap/dcae/collectors/veshv/tests/fakes/metrics.kt
+++ b/sources/hv-collector-ct/src/test/kotlin/org/onap/dcae/collectors/veshv/tests/fakes/metrics.kt
@@ -24,6 +24,7 @@ import org.onap.dcae.collectors.veshv.domain.WireFrameMessage
import org.onap.dcae.collectors.veshv.model.ClientRejectionCause
import org.onap.dcae.collectors.veshv.model.MessageDropCause
import org.onap.dcae.collectors.veshv.domain.RoutedMessage
+import org.onap.dcae.collectors.veshv.domain.VesMessage
import java.time.Duration
import java.time.Instant
import kotlin.test.fail
@@ -38,6 +39,7 @@ class FakeMetrics : Metrics {
var messageBytesReceived: Int = 0; private set
var messagesDroppedCount: Int = 0; private set
var lastProcessingTimeMicros: Double = -1.0; private set
+ var lastProcessingTimeWithoutRoutingMicros: Double = -1.0; private set
var messagesSentCount: Int = 0; private set
var clientRejectionCause = mutableMapOf<ClientRejectionCause, Int>(); private set
@@ -52,6 +54,10 @@ class FakeMetrics : Metrics {
messageBytesReceived += msg.payloadSize
}
+ override fun notifyMessageReadyForRouting(msg: VesMessage) {
+ lastProcessingTimeWithoutRoutingMicros = Duration.between(msg.wtpFrame.receivedAt, Instant.now()).toNanos() / 1000.0
+ }
+
override fun notifyMessageSent(msg: RoutedMessage) {
messagesSentCount++
messagesSentToTopic.compute(msg.targetTopic) { k, _ ->