aboutsummaryrefslogtreecommitdiffstats
path: root/sources/hv-collector-test-utils
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-test-utils
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-test-utils')
-rw-r--r--sources/hv-collector-test-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/tests/utils/vesEvents.kt11
1 files changed, 8 insertions, 3 deletions
diff --git a/sources/hv-collector-test-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/tests/utils/vesEvents.kt b/sources/hv-collector-test-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/tests/utils/vesEvents.kt
index ba60d1b0..3013e904 100644
--- a/sources/hv-collector-test-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/tests/utils/vesEvents.kt
+++ b/sources/hv-collector-test-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/tests/utils/vesEvents.kt
@@ -30,6 +30,8 @@ import org.onap.dcae.collectors.veshv.domain.WireFrameMessage
import org.onap.ves.VesEventOuterClass
import org.onap.ves.VesEventOuterClass.CommonEventHeader
import org.onap.ves.VesEventOuterClass.CommonEventHeader.Priority
+import java.time.Instant
+import java.time.temporal.Temporal
import java.util.UUID.randomUUID
fun vesEvent(domain: VesEventDomain = PERF3GPP,
@@ -53,7 +55,7 @@ fun commonHeader(domain: VesEventDomain = PERF3GPP,
vesEventListenerVersion: String = "7.0.2",
priority: Priority = Priority.NORMAL,
lastEpochMicrosec: Long = 100000005
- ): CommonEventHeader =
+): CommonEventHeader =
CommonEventHeader.newBuilder()
.setVersion("sample-version")
.setDomain(domain.domainName)
@@ -86,14 +88,17 @@ fun wireProtocolFrameWithPayloadSize(size: Int): WireFrameMessage = WireFrameMes
payloadType = PayloadContentType.GOOGLE_PROTOCOL_BUFFER.hexValue
)
-fun wireProtocolFrame(commonHeader: CommonEventHeader, eventFields: ByteString = ByteString.EMPTY): WireFrameMessage =
+fun wireProtocolFrame(commonHeader: CommonEventHeader,
+ eventFields: ByteString = ByteString.EMPTY,
+ receivedAt: Temporal = Instant.now()): WireFrameMessage =
vesEventBytes(commonHeader, eventFields).let { payload ->
WireFrameMessage(
payload = payload,
versionMajor = WireFrameMessage.SUPPORTED_VERSION_MAJOR,
versionMinor = WireFrameMessage.SUPPORTED_VERSION_MINOR,
payloadSize = payload.size(),
- payloadType = PayloadContentType.GOOGLE_PROTOCOL_BUFFER.hexValue
+ payloadType = PayloadContentType.GOOGLE_PROTOCOL_BUFFER.hexValue,
+ receivedAt = receivedAt
)
}