Calculating Queuing Delay for a DataReader

4 posts / 0 new
Last post
Offline
Last seen: 9 months 1 week ago
Joined: 10/24/2013
Posts: 15
Calculating Queuing Delay for a DataReader

Hi,

I am trying to understand how I can calculate the queuing delay of messages for a DataReader's receive queue. For example, if a message entered a DataReader's receive queue at time-stamp t1 and the take() operation was called at time-stamp t2, I am interested in calculating (t2-t1).  Similarly, I would like to calculate the queuing delay for DataWriter's send queue. 

Can you please let me know if there are methods/fields exposed by the DDS API which can help me in this regard? 

Thank you,

Shweta 

Receive Queue Reference:

https://community.rti.com/static/documentation/connext-dds/5.2.3/doc/manuals/connext_dds/html_files/RTI_ConnextDDS_CoreLibraries_UsersManual/Content/UsersManual/Tuning_Queue_Sizes_and_Other_Resource_Li.htm#reliable_1394042328_783720

Organization:
Offline
Last seen: 4 months 1 week ago
Joined: 02/20/2014
Posts: 9

I might be wrong, but I think the receive timestamp present in the DDS_SampleInfo struct for a given message should be the system time at the time of reception and queuing by the subscriber.  So it should just be a matter of taking the time when you call take() yourself and then finding that delta.

Offline
Last seen: 9 months 1 week ago
Joined: 10/24/2013
Posts: 15

Hi, 

Thank you for your reply. Yes, I had taken a look at the reception_timestamp field, but I was not sure by what is meant by: "The timestamp when the sample was committed by a DataReader"

Thanks,

Shweta 

Offline
Last seen: 9 months 1 week ago
Joined: 10/24/2013
Posts: 15

Hi,

I was reading 5.2.3's documentation which explains reception_timestamp and the concept of when a sample was committed by a DataReader:

Reception Timestamp:  In reliable communication, if DDS data samples are received out of order, Connext DDS will not deliver them until all the previous DDS data samples have been received. For example, if DDS sample 2 arrives before DDS sample 1, DDS sample 2 cannot be delivered until DDS sample 1 is received. The reception_timestamp is the time when all previous DDS samples has been received—the time at which the DDS sample is committed. If DDS samples are all received in order, the committed time will be same as reception time. However, if DDS samples are lost on the wire, then the committed time will be later than the initial reception time.

 
With this definition, the time difference between reception_timestamp and when take() is called from DataReader's on_data_available will not reflect the queuing delay for the DataReader. If the samples are always received in order, this time difference will most likely always be 0 ms. How can I calculate the queueing delay for DataReader's receive queue? 

 

I also want to find out the queueing delay for an Asynchronous DataWriter's send queue, i.e., the difference between the timestamp at which the sample enters the Writer's send queue and the timestamp at which the sample is sent over the network. Is there some way I can do this and what API calls can I use? 

Thank you,

Shweta