How to obtain the metrics that the DataReader drops out-of-order samples?

4 posts / 0 new
Last post
Offline
Last seen: 2 weeks 6 days ago
Joined: 10/09/2024
Posts: 4
How to obtain the metrics that the DataReader drops out-of-order samples?

May I know if we have callback or the metrics when the BEST_EFFORT DataReader drops out-of-order samples?

It would be the best if we have callback. Because we want to capture the history but don't want the overhead of reliable channel.

Howard's picture
Offline
Last seen: 1 day 2 hours ago
Joined: 11/29/2012
Posts: 607

No, there are no metrics or callbacks triggered when a data sample is received and must be dropped becuase it has an older sequence number than the sequence number of the last data sample received (for the DataWriter), aka "out-of-order" samples.

Offline
Last seen: 2 weeks 6 days ago
Joined: 10/09/2024
Posts: 4

Thanks Howard, can we obtain writer sequence number of the sample (which I can see in the Wireshark)? So my idea is to measure the differences between the writer sequence number so as to monitor if there are any sample loss due to out-of-order samples. Do you think if this works?

Howard's picture
Offline
Last seen: 1 day 2 hours ago
Joined: 11/29/2012
Posts: 607

Yes, you can certainly do that...however, the publication sequence number is unique to each DataWriter.  So if there are multiple DataWriters of a topic, you will need to keep track of the last sequence number received per DataWriter.

All of the information that you need, publication sequence number, writer handle, can be found in the SampleInfo object that is provided for each data sample.