Calculate AVG.Rate in mikrotik API

Hi Guys
I need to calculate queue avg download and upload rate in simple queue.
I used mikrotik API via vb.net.

please tips me.
Thnaks in advance

please be more specific where is the problem? Reading the rates? Calculating the average? Choosing what average exactly you want to have?