Skip to content

Test SPAT Timestamp Delta Event

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

SPaT Timestamp Delta Events and Notifications

Inputs

A series of 4 ProcessedSpat messages with the OdeReceivedAt time offset relative to utcTimestamp by:

  • -20 ms
  • 600 ms
  • 1200 ms
  • -700 ms

Test Script

TimestampDelta-ProcessedSpats.csv

Output Topics

  • topic.CmTimestampDeltaEvent
  • topic.CmTimestampDeltaNotification

Expected Output

Events

4 events similar to:

Topic: topic.CmTimestampDeltaEvent
Key: {"rsuId":"10.164.6.18","intersectionId":6311,"region":-1}
Offset: 3
Timestamp: 1724305898047
Value: {
	"eventGeneratedAt":1724305898174,
	"eventType":"SpatTimestampDelta",
	"intersectionID":6311,
	"roadRegulatorID":-1,
	"inputType":"us.dot.its.jpo.geojsonconverter.pojos.spat.ProcessedSpat",
	"source":"10.164.6.18",
	"delta": {
		"maxDeltaMillis":50,
		"odeIngestTimestampMillis":1724305898047,
		"messageTimestampMillis":1724305898067,
		"deltaMillis":-20,
		"absDeltaMillis":20,
		"odeIngestBeforeMessageTimestamp":true,
		"deltaGreaterThanMax":false
	}
}
% Reached end of topic topic.CmTimestampDeltaEvent [0] at offset 4

Topic: topic.CmTimestampDeltaEvent
Key: {"rsuId":"10.164.6.18","intersectionId":6311,"region":-1}
Offset: 4
Timestamp: 1724305900047
Value: {
	"eventGeneratedAt":1724305900069,
	"eventType":"SpatTimestampDelta",
	"intersectionID":6311,
	"roadRegulatorID":-1,
	"inputType":"us.dot.its.jpo.geojsonconverter.pojos.spat.ProcessedSpat",
	"source":"10.164.6.18",
	"delta": {
		"maxDeltaMillis":50,
		"odeIngestTimestampMillis":1724305900047,
		"messageTimestampMillis":1724305899447,
		"deltaMillis":600,
		"absDeltaMillis":600,
		"odeIngestBeforeMessageTimestamp":false,
		"deltaGreaterThanMax":true
	}
}
% Reached end of topic topic.CmTimestampDeltaEvent [0] at offset 5

Topic: topic.CmTimestampDeltaEvent
Key: {"rsuId":"10.164.6.18","intersectionId":6311,"region":-1}
Offset: 5
Timestamp: 1724305902047
Value: {
	"eventGeneratedAt":1724305902071,
	"eventType":"SpatTimestampDelta",
	"intersectionID":6311,
	"roadRegulatorID":-1,
	"inputType":"us.dot.its.jpo.geojsonconverter.pojos.spat.ProcessedSpat",
	"source":"10.164.6.18",
	"delta": {
		"maxDeltaMillis":50,
		"odeIngestTimestampMillis":1724305902047,
		"messageTimestampMillis":1724305900847,
		"deltaMillis":1200,
		"absDeltaMillis":1200,
		"odeIngestBeforeMessageTimestamp":false,
		"deltaGreaterThanMax":true
	}
}
% Reached end of topic topic.CmTimestampDeltaEvent [0] at offset 6

Topic: topic.CmTimestampDeltaEvent
Key: {"rsuId":"10.164.6.18","intersectionId":6311,"region":-1}
Offset: 6
Timestamp: 1724305904047
Value: {
	"eventGeneratedAt":1724305904056,
	"eventType":"SpatTimestampDelta",
	"intersectionID":6311,
	"roadRegulatorID":-1,
	"inputType":"us.dot.its.jpo.geojsonconverter.pojos.spat.ProcessedSpat",
	"source":"10.164.6.18",
	"delta": {
		"maxDeltaMillis":50,
		"odeIngestTimestampMillis":1724305904047,
		"messageTimestampMillis":1724305904747,
		"deltaMillis":-700,
		"absDeltaMillis":700,
		"odeIngestBeforeMessageTimestamp":true,
		"deltaGreaterThanMax":true
	}
}
% Reached end of topic topic.CmTimestampDeltaEvent [0] at offset 7

Notifications

After the retention time period passes, one notification like:

Topic: topic.CmTimestampDeltaNotification
Key: {"rsuId":"10.164.6.18","intersectionId":6311,"region":-1}
Offset: 1
Timestamp: 1724305941081
Value: {
	"key":"SpatTimestampDeltaNotification_-1_6311_1724305761081_1724305941081",
	"notificationGeneratedAt":1724305941085,
	"notificationType":"SpatTimestampDeltaNotification",
	"notificationText":"There were differences between the ODE ingest time and message timestamp.",
	"notificationHeading":"SPaT Timestamp Delta Notification",
	"intersectionID":6311,
	"roadRegulatorID":-1,
	"timePeriod": {
		"beginTimestamp":1724305761081,
		"endTimestamp":1724305941081
	},
	"numberOfEvents":4,
	"minDeltaMillis":-700,
	"maxDeltaMillis":1200,
	"absMedianDeltaMillis":650.0,
	"uniqueId":"SpatTimestampDeltaNotification_-1_6311_1724305761081_1724305941081"
}
% Reached end of topic topic.CmTimestampDeltaNotification [0] at offset 2

Comments

For testing, the parameter spat.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.