Skip to content

Test MAP Timestamp Delta Event

Ivan Yourshaw edited this page Aug 22, 2024 · 2 revisions

MAP Timestamp Delta Events and Notifications

Inputs

A series of 4 ProcessedMap messages with the OdeReceivedAt time offset relative to timeStamp by:

  • 10 ms
  • 600 ms
  • 1000 ms
  • -600 ms

Test Script

TimestampDelta-ProcessedMap.csv

Output Topics

  • topic.CmTimestampDeltaEvent
  • topic.CmTimestampDeltaNotification

Expected Output

Events

The first MAP should not produce any events. The other 3 should produce 3 events similar to:

Topic: topic.CmTimestampDeltaEvent
Key: {"rsuId":"10.164.6.16","intersectionId":6311,"region":-1}
Offset: 0
Timestamp: 1724304910990
Value: {
    "eventGeneratedAt":1724304911047,
    "eventType":"MapTimestampDelta",
    "intersectionID":6311,
    "roadRegulatorID":-1,
    "inputType":"us.dot.its.jpo.geojsonconverter.pojos.geojson.map.ProcessedMap",
    "source":"10.164.6.16",
    "delta": {
        "maxDeltaMillis":50,
        "odeIngestTimestampMillis":1724304910990,
        "messageTimestampMillis":1724304910390,
        "deltaMillis":600,
        "absDeltaMillis":600,
        "odeIngestBeforeMessageTimestamp":false,
        "deltaGreaterThanMax":true
    }
}
% Reached end of topic topic.CmTimestampDeltaEvent [0] at offset 1

Topic: topic.CmTimestampDeltaEvent
Key: {"rsuId":"10.164.6.16","intersectionId":6311,"region":-1}
Offset: 1
Timestamp: 1724304912990
Value: {
    "eventGeneratedAt":1724304913010,
    "eventType":"MapTimestampDelta",
    "intersectionID":6311,
    "roadRegulatorID":-1,
    "inputType":"us.dot.its.jpo.geojsonconverter.pojos.geojson.map.ProcessedMap",
    "source":"10.164.6.16",
    "delta": {
        "maxDeltaMillis":50,
        "odeIngestTimestampMillis":1724304912990,
        "messageTimestampMillis":1724304911990,
        "deltaMillis":1000,
        "absDeltaMillis":1000,
        "odeIngestBeforeMessageTimestamp":false,
        "deltaGreaterThanMax":true
    }
}
% Reached end of topic topic.CmTimestampDeltaEvent [0] at offset 2

Topic: topic.CmTimestampDeltaEvent
Key: {"rsuId":"10.164.6.16","intersectionId":6311,"region":-1}
Offset: 2
Timestamp: 1724304914990
Value: 
{
    "eventGeneratedAt":1724304915008,
    "eventType":"MapTimestampDelta",
    "intersectionID":6311,
    "roadRegulatorID":-1,
    "inputType":"us.dot.its.jpo.geojsonconverter.pojos.geojson.map.ProcessedMap",
    "source":"10.164.6.16",
    "delta": {
        "maxDeltaMillis":50,
        "odeIngestTimestampMillis":1724304914990,
        "messageTimestampMillis":1724304915590,
        "deltaMillis":-600,
        "absDeltaMillis":600,
        "odeIngestBeforeMessageTimestamp":true,
        "deltaGreaterThanMax":true
    }
}
% Reached end of topic topic.CmTimestampDeltaEvent [0] at offset 3

Notifications

After the retention time period passes, there should be a notification like:

Topic: topic.CmTimestampDeltaNotification
Key: {"rsuId":"10.164.6.16","intersectionId":6311,"region":-1}
Offset: 0
Timestamp: 1724305040901
Value: {
    "key":"MapTimestampDeltaNotification_-1_6311_1724304860901_1724305040901",
    "notificationGeneratedAt":1724305040964,
    "notificationType":"MapTimestampDeltaNotification",
    "notificationText":"There were differences between the ODE ingest time and message timestamp.",
    "notificationHeading":"MAP Timestamp Delta Notification",
    "intersectionID":6311,
    "roadRegulatorID":-1,
    "timePeriod": {
        "beginTimestamp":1724304860901,
        "endTimestamp":1724305040901
    },
    "numberOfEvents":3,
    "minDeltaMillis":-600,
    "maxDeltaMillis":1000,
    "absMedianDeltaMillis":600.0,
    "uniqueId":"MapTimestampDeltaNotification_-1_6311_1724304860901_1724305040901"
}
% Reached end of topic topic.CmTimestampDeltaNotification [0] at offset 1

Comments

For testing, the parameter map.timestamp.delta.retentionTimeMinutes in application.yaml can be set to a smaller value, such as 5 minutes. Otherwise the notification will take up to the default 60 minutes to appear.