How can I calculate bytes received on a channel in a UPA application.

andy.sciascia
andy.sciascia Contributor

I want to record the number of update bytes received on a channel in my UPA application.

I think what I need to do is, for all RSSL_MC_REFRESH and RSSL_MC_UPDATE messages get the size of the data in the RsslUpdateMsg or RsslUpdateMsg message before I decode it.

I'm guessing that the size is either msgBase.encDataBody.length or msgBase.encMsgBuffer.length but I'm not sure which.

The descriptions of encDataBody and encMsgBuffer are a bit confusing as they say the buffers are populated by the user. But I'm guessing thats for message the app creates and that when a message is received by the app the contents of these buffers reflect what's been received from the ADS. Is that correct ?

Best Answer

  • zoya faberov
    zoya faberov ✭✭✭✭✭
    Answer ✓

    Hello @andy.sciascia,

    Correct.

    Both measurements should work the same to calculate the bytes received via refreshes and updates, as encoded data body gets encoded into a buffer.

    I would go with encodedDataBody.length() as it's easier and is available to the parsing code quicker, but either should work.

Welcome!

It looks like you're new here. Sign in or register to get started.

Welcome!

It looks like you're new here. Sign in or register to get started.