diff options
10 files changed, 54 insertions, 45 deletions
@@ -35,7 +35,7 @@ For more details on the rationale, please read a [high-level feature description VES-HV was designed to allow for extendability - by adding new domain-specific PROTO files. -The PROTO file, which contains the VES CommonHeader, comes with a binary-type Payload parameter, where domain-specific data shall be placed. Domain-specific data are encoded as well with GPB, and they do require a domain-specific PROTO file to decode the data. This domain-specific PROTO needs to be shared with analytics applications - VES-HV is not analyzing domain-specific data. In order to support the RT-PM use-case, VES-HV includes a "PERF3GPP" domain PROTO file, as within this domain, the high volume data is expected to be reported to VES-HV collector. +The PROTO file, which contains the VES CommonHeader, comes with a binary-type Payload parameter, where domain-specific data shall be placed. Domain-specific data are encoded as well with GPB, and they do require a domain-specific PROTO file to decode the data. This domain-specific PROTO needs to be shared with analytics applications - VES-HV is not analyzing domain-specific data. In order to support the RT-PM use-case, VES-HV includes a "perf3gpp" domain PROTO file, as within this domain, the high volume data is expected to be reported to VES-HV collector. Still, there are no limitations to define additional domains, based on existing VES domains (like Fault, Heartbeat) or completely new domains. New domains can be added "when needed". In case of new domains, it is necessary to extend the Common Header PROTO "Domain" enumeration with new values covering this new domain(s). diff --git a/hv-collector-core/src/test/kotlin/org/onap/dcae/collectors/veshv/impl/RouterTest.kt b/hv-collector-core/src/test/kotlin/org/onap/dcae/collectors/veshv/impl/RouterTest.kt index 5195948e..e8a31231 100644 --- a/hv-collector-core/src/test/kotlin/org/onap/dcae/collectors/veshv/impl/RouterTest.kt +++ b/hv-collector-core/src/test/kotlin/org/onap/dcae/collectors/veshv/impl/RouterTest.kt @@ -45,13 +45,13 @@ object RouterTest : Spek({ val config = routing { defineRoute { - fromDomain(PERF3GPP.name) + fromDomain(PERF3GPP.domainName) toTopic("ves_rtpm") withFixedPartitioning(2) } defineRoute { - fromDomain(SYSLOG.name) + fromDomain(SYSLOG.domainName) toTopic("ves_trace") withFixedPartitioning() } diff --git a/hv-collector-core/src/test/kotlin/org/onap/dcae/collectors/veshv/impl/adapters/ConsulConfigurationProviderTest.kt b/hv-collector-core/src/test/kotlin/org/onap/dcae/collectors/veshv/impl/adapters/ConsulConfigurationProviderTest.kt index f21a2ecf..9a6889c8 100644 --- a/hv-collector-core/src/test/kotlin/org/onap/dcae/collectors/veshv/impl/adapters/ConsulConfigurationProviderTest.kt +++ b/hv-collector-core/src/test/kotlin/org/onap/dcae/collectors/veshv/impl/adapters/ConsulConfigurationProviderTest.kt @@ -22,6 +22,7 @@ package org.onap.dcae.collectors.veshv.impl.adapters import com.nhaarman.mockito_kotlin.eq import com.nhaarman.mockito_kotlin.mock import com.nhaarman.mockito_kotlin.whenever +import org.assertj.core.api.Assertions.assertThat import org.jetbrains.spek.api.Spek import org.jetbrains.spek.api.dsl.describe import org.jetbrains.spek.api.dsl.given @@ -67,12 +68,20 @@ internal object ConsulConfigurationProviderTest : Spek({ assertEquals("$kafkaAddress:9093", it.kafkaBootstrapServers) val route1 = it.routing.routes[0] - assertEquals(FAULT.name, route1.domain) - assertEquals("test-topic-1", route1.targetTopic) + assertThat(FAULT.domainName) + .describedAs("routed domain 1") + .isEqualTo(route1.domain) + assertThat("test-topic-1") + .describedAs("target topic 1") + .isEqualTo(route1.targetTopic) val route2 = it.routing.routes[1] - assertEquals(HEARTBEAT.name, route2.domain) - assertEquals("test-topic-2", route2.targetTopic) + assertThat(HEARTBEAT.domainName) + .describedAs("routed domain 2") + .isEqualTo(route2.domain) + assertThat("test-topic-2") + .describedAs("target topic 2") + .isEqualTo(route2.targetTopic) }.verifyComplete() } @@ -138,11 +147,11 @@ fun constructConsulResponse(): String { "dmaap.kafkaBootstrapServers": "$kafkaAddress:9093", "collector.routing": [ { - "fromDomain": "FAULT", + "fromDomain": "fault", "toTopic": "test-topic-1" }, { - "fromDomain": "HEARTBEAT", + "fromDomain": "heartbeat", "toTopic": "test-topic-2" } ] diff --git a/hv-collector-ct/src/test/kotlin/org/onap/dcae/collectors/veshv/tests/fakes/configuration.kt b/hv-collector-ct/src/test/kotlin/org/onap/dcae/collectors/veshv/tests/fakes/configuration.kt index 432b6976..3770913a 100644 --- a/hv-collector-ct/src/test/kotlin/org/onap/dcae/collectors/veshv/tests/fakes/configuration.kt +++ b/hv-collector-ct/src/test/kotlin/org/onap/dcae/collectors/veshv/tests/fakes/configuration.kt @@ -39,7 +39,7 @@ val basicConfiguration: CollectorConfiguration = CollectorConfiguration( kafkaBootstrapServers = "localhost:9969", routing = routing { defineRoute { - fromDomain(PERF3GPP.name) + fromDomain(PERF3GPP.domainName) toTopic(PERF3GPP_TOPIC) withFixedPartitioning() } @@ -50,17 +50,17 @@ val twoDomainsToOneTopicConfiguration: CollectorConfiguration = CollectorConfigu kafkaBootstrapServers = "localhost:9969", routing = routing { defineRoute { - fromDomain(PERF3GPP.name) + fromDomain(PERF3GPP.domainName) toTopic(PERF3GPP_TOPIC) withFixedPartitioning() } defineRoute { - fromDomain(HEARTBEAT.name) + fromDomain(HEARTBEAT.domainName) toTopic(PERF3GPP_TOPIC) withFixedPartitioning() } defineRoute { - fromDomain(MEASUREMENT.name) + fromDomain(MEASUREMENT.domainName) toTopic(MEASUREMENTS_FOR_VF_SCALING_TOPIC) withFixedPartitioning() } @@ -72,7 +72,7 @@ val configurationWithDifferentRouting: CollectorConfiguration = CollectorConfigu kafkaBootstrapServers = "localhost:9969", routing = routing { defineRoute { - fromDomain(PERF3GPP.name) + fromDomain(PERF3GPP.domainName) toTopic(ALTERNATE_PERF3GPP_TOPIC) withFixedPartitioning() } diff --git a/hv-collector-domain/src/main/kotlin/org/onap/dcae/collectors/veshv/domain/VesEventDomain.kt b/hv-collector-domain/src/main/kotlin/org/onap/dcae/collectors/veshv/domain/VesEventDomain.kt index 322260c6..0b18337d 100644 --- a/hv-collector-domain/src/main/kotlin/org/onap/dcae/collectors/veshv/domain/VesEventDomain.kt +++ b/hv-collector-domain/src/main/kotlin/org/onap/dcae/collectors/veshv/domain/VesEventDomain.kt @@ -19,17 +19,17 @@ */ package org.onap.dcae.collectors.veshv.domain -enum class VesEventDomain { - FAULT, - HEARTBEAT, - MEASUREMENT, - MOBILE_FLOW, - OTHER, - PNFREGISTRATION, - SIP_SIGNALING, - STATE_CHANGE, - SYSLOG, - THRESHOLD_CROSSING_ALERT, - VOICE_QUALITY, - PERF3GPP +enum class VesEventDomain(val domainName: String) { + FAULT("fault"), + HEARTBEAT("heartbeat"), + MEASUREMENT("measurement"), + MOBILE_FLOW("mobileFlow"), + OTHER("other"), + PNF_REGISTRATION("pnfRegistration"), + SIP_SIGNALING("sipSignaling"), + STATE_CHANGE("stateChange"), + SYSLOG("syslog"), + THRESHOLD_CROSSING_ALERT("thresholdCrossingAlert"), + VOICE_QUALITY("voiceQuality"), + PERF3GPP("perf3gpp"); } diff --git a/hv-collector-domain/src/main/proto/event/VesEvent.proto b/hv-collector-domain/src/main/proto/event/VesEvent.proto index f7822425..dcd54640 100644 --- a/hv-collector-domain/src/main/proto/event/VesEvent.proto +++ b/hv-collector-domain/src/main/proto/event/VesEvent.proto @@ -28,7 +28,7 @@ message VesEvent // top-level message // this field contains a domain-specific GPB message // the field being opaque (bytes), the decoding of the payload occurs in a separate step // the name of the GPB message for domain XYZ is XYZFields - // e.g. for domain==PERF3GPP, the GPB message is Perf3GPPFields + // e.g. for domain==perf3gpp, the GPB message is Perf3GPPFields } // VES CommonEventHeader adapted to GPB (Google Protocol Buffers) @@ -38,8 +38,8 @@ message CommonEventHeader { string version = 1; // required, "version of the gpb common event header" string domain = 2; // required, "the eventing domain associated with the event", allowed values: - // FAULT, HEARTBEAT, MEASUREMENT, MOBILE_FLOW, OTHER, PNFREGISTRATION, SIP_SIGNALING, - // STATE_CHANGE, SYSLOG, THRESHOLD_CROSSING_ALERT, VOICE_QUALITY, PERF3GPP + // fault, heartbeat, measurement, mobile_flow, other, pnfregistration, sip_signaling, + // state_change, syslog, threshold_crossing_alert, voice_quality, perf3gpp uint32 sequence = 3; // required, "ordering of events communicated by an event source instance or 0 if not needed" diff --git a/hv-collector-main/src/test/kotlin/org/onap/dcae/collectors/veshv/main/MicrometerMetricsTest.kt b/hv-collector-main/src/test/kotlin/org/onap/dcae/collectors/veshv/main/MicrometerMetricsTest.kt index 3fdb0b5b..a379933e 100644 --- a/hv-collector-main/src/test/kotlin/org/onap/dcae/collectors/veshv/main/MicrometerMetricsTest.kt +++ b/hv-collector-main/src/test/kotlin/org/onap/dcae/collectors/veshv/main/MicrometerMetricsTest.kt @@ -163,7 +163,7 @@ object MicrometerMetricsTest : Spek({ cut.notifyMessageReceived(128) cut.notifyMessageReceived(256) cut.notifyMessageReceived(256) - cut.notifyMessageSent("PERF3GPP") + cut.notifyMessageSent("perf3gpp") verifyGauge("messages.processing.count") { gauge -> assertThat(gauge.value()).isCloseTo(2.0, doublePrecision) } @@ -171,7 +171,7 @@ object MicrometerMetricsTest : Spek({ on("zero difference") { cut.notifyMessageReceived(128) - cut.notifyMessageSent("PERF3GPP") + cut.notifyMessageSent("perf3gpp") verifyGauge("messages.processing.count") { gauge -> assertThat(gauge.value()).isCloseTo(0.0, doublePrecision) } @@ -179,8 +179,8 @@ object MicrometerMetricsTest : Spek({ on("negative difference") { cut.notifyMessageReceived(128) - cut.notifyMessageSent("FAULT") - cut.notifyMessageSent("PERF3GPP") + cut.notifyMessageSent("fault") + cut.notifyMessageSent("perf3gpp") verifyGauge("messages.processing.count") { gauge -> assertThat(gauge.value()).isCloseTo(0.0, doublePrecision) } diff --git a/hv-collector-test-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/tests/utils/vesEvents.kt b/hv-collector-test-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/tests/utils/vesEvents.kt index 0cbd6505..20d0c50f 100644 --- a/hv-collector-test-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/tests/utils/vesEvents.kt +++ b/hv-collector-test-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/tests/utils/vesEvents.kt @@ -47,7 +47,7 @@ fun commonHeader(domain: VesEventDomain = PERF3GPP, priority: Priority = Priority.NORMAL): CommonEventHeader = CommonEventHeader.newBuilder() .setVersion("sample-version") - .setDomain(domain.name) + .setDomain(domain.domainName) .setSequence(1) .setPriority(priority) .setEventId(id) diff --git a/hv-collector-ves-message-generator/src/test/kotlin/org/onap/dcae/collectors/veshv/ves/message/generator/impl/impl/MessageGeneratorImplTest.kt b/hv-collector-ves-message-generator/src/test/kotlin/org/onap/dcae/collectors/veshv/ves/message/generator/impl/impl/MessageGeneratorImplTest.kt index dedf5ccf..ec09ac9c 100644 --- a/hv-collector-ves-message-generator/src/test/kotlin/org/onap/dcae/collectors/veshv/ves/message/generator/impl/impl/MessageGeneratorImplTest.kt +++ b/hv-collector-ves-message-generator/src/test/kotlin/org/onap/dcae/collectors/veshv/ves/message/generator/impl/impl/MessageGeneratorImplTest.kt @@ -88,7 +88,7 @@ object MessageGeneratorImplTest : Spek({ .assertNext { assertThat(it.isValid()).isTrue() assertThat(it.payloadSize).isLessThan(WireFrameMessage.MAX_PAYLOAD_SIZE) - assertThat(extractCommonEventHeader(it.payload).domain).isEqualTo(FAULT.name) + assertThat(extractCommonEventHeader(it.payload).domain).isEqualTo(FAULT.domainName) } .verifyComplete() } @@ -106,7 +106,7 @@ object MessageGeneratorImplTest : Spek({ .assertNext { assertThat(it.isValid()).isTrue() assertThat(it.payloadSize).isGreaterThan(WireFrameMessage.MAX_PAYLOAD_SIZE) - assertThat(extractCommonEventHeader(it.payload).domain).isEqualTo(PERF3GPP.name) + assertThat(extractCommonEventHeader(it.payload).domain).isEqualTo(PERF3GPP.domainName) } .verifyComplete() } @@ -141,7 +141,7 @@ object MessageGeneratorImplTest : Spek({ .assertNext { assertThat(it.isValid()).isFalse() assertThat(it.payloadSize).isLessThan(WireFrameMessage.MAX_PAYLOAD_SIZE) - assertThat(extractCommonEventHeader(it.payload).domain).isEqualTo(PERF3GPP.name) + assertThat(extractCommonEventHeader(it.payload).domain).isEqualTo(PERF3GPP.domainName) assertThat(it.versionMajor).isNotEqualTo(WireFrameMessage.SUPPORTED_VERSION_MINOR) } .verifyComplete() @@ -160,7 +160,7 @@ object MessageGeneratorImplTest : Spek({ assertThat(it.isValid()).isTrue() assertThat(it.payloadSize).isLessThan(WireFrameMessage.MAX_PAYLOAD_SIZE) assertThat(extractEventFields(it.payload).size()).isEqualTo(MessageGenerator.FIXED_PAYLOAD_SIZE) - assertThat(extractCommonEventHeader(it.payload).domain).isEqualTo(FAULT.name) + assertThat(extractCommonEventHeader(it.payload).domain).isEqualTo(FAULT.domainName) } .verifyComplete() } @@ -178,17 +178,17 @@ object MessageGeneratorImplTest : Spek({ .test() .assertNext { assertThat(it.payloadSize).isLessThan(WireFrameMessage.MAX_PAYLOAD_SIZE) - assertThat(extractCommonEventHeader(it.payload).domain).isEqualTo(PERF3GPP.name) + assertThat(extractCommonEventHeader(it.payload).domain).isEqualTo(PERF3GPP.domainName) } .expectNextCount(singleFluxSize - 1) .assertNext { assertThat(it.payloadSize).isGreaterThan(WireFrameMessage.MAX_PAYLOAD_SIZE) - assertThat(extractCommonEventHeader(it.payload).domain).isEqualTo(FAULT.name) + assertThat(extractCommonEventHeader(it.payload).domain).isEqualTo(FAULT.domainName) } .expectNextCount(singleFluxSize - 1) .assertNext { assertThat(it.payloadSize).isLessThan(WireFrameMessage.MAX_PAYLOAD_SIZE) - assertThat(extractCommonEventHeader(it.payload).domain).isEqualTo(HEARTBEAT.name) + assertThat(extractCommonEventHeader(it.payload).domain).isEqualTo(HEARTBEAT.domainName) } .expectNextCount(singleFluxSize - 1) .verifyComplete() diff --git a/hv-collector-ves-message-generator/src/test/kotlin/org/onap/dcae/collectors/veshv/ves/message/generator/impl/impl/parameters.kt b/hv-collector-ves-message-generator/src/test/kotlin/org/onap/dcae/collectors/veshv/ves/message/generator/impl/impl/parameters.kt index 00c08aa7..dd8bc89f 100644 --- a/hv-collector-ves-message-generator/src/test/kotlin/org/onap/dcae/collectors/veshv/ves/message/generator/impl/impl/parameters.kt +++ b/hv-collector-ves-message-generator/src/test/kotlin/org/onap/dcae/collectors/veshv/ves/message/generator/impl/impl/parameters.kt @@ -26,7 +26,7 @@ private const val validMessageParameters = { "commonEventHeader": { "version": "sample-version", - "domain": "PERF3GPP", + "domain": "perf3gpp", "sequence": 1, "priority": 1, "eventId": "sample-event-id", @@ -48,7 +48,7 @@ private const val validMessageParameters = { "commonEventHeader": { "version": "sample-version", - "domain": "PERF3GPP", + "domain": "perf3gpp", "sequence": 1, "priority": 1, "eventId": "sample-event-id", @@ -76,7 +76,7 @@ private const val invalidMessageParameters = { "commonEventHeader": { "version": "sample-version", - "domain": "PERF3GPP", + "domain": "perf3gpp", "sequence": 1, "priority": 1, "eventId": "sample-event-id", |