-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: SDAM
Use Case
The monitor currently captures rtt samples with the following code:
// NOTE: here we use the latestRtt as this measurement corresponds with the value // obtained for this successful heartbeat, if there is no latestRtt, then we calculate the // duration const duration = isAwaitable && monitor.rttPinger ? (monitor.rttPinger.latestRtt ?? calculateDurationInMs(start)) : calculateDurationInMs(start); monitor.addRttSample(duration);
This code executes on every heartbeat succeeded event.
(when using the streaming monitoring protocol, `isAwaitable` is true and `rttPinger` exists on the monitor).
Notice two things when the streaming protocol is set:
1. The duration of the heartbeat event is set to the last recorded rtt pinging event
2. the monitor records the sample unconditionally as an rtt sample
This means rtt pinging events aren't recorded unless heartbeat events finish. And conversely, if an awaitable, exhaustAllowed hello resulted in multiple heartbeat events in less than `heartbeatFrequencyMS`, we'd record multiple rtt samples from the same rtt measurement.
Instead, when the streaming protocol is enabled, we should only record rtt samples from round trip measurements on the RTTPinger.
User Experience
This bug likely has little impact on users because in practice because the rttpinger's ping interval and the frequency of streaming hellos should be roughly aligned (rttpingers poll every heartbeatFrequencyMS, awaitable hellos wait for heartbeatFrequencyMS). In circumstances where multiple heartbeat events are recorded in less than heartbeatFrequencyMS, this results in multiple recorded for the same rtt pinger value, skewing the average and min rtt measurements towards the most recent sample for a period of time.
Dependencies
n/a
Risks/Unknowns
n/a
Acceptance Criteria
Implementation Requirements
- when streaming is enabled
- Do not record rtt samples after heartbeats succeed.
- Record rtt samples for each successful rtt measurement.
Testing Requirements
- I'm not sure the best way to test this.
Documentation Requirements
n/a
Follow Up Requirements
n/a