How could I estimate the instantaneous throughput ? For example, in a way similar to what the browser does when downloading a file. It’s not just a mean throughput, but rather the an instantaneous estimation, maybe with a ‘moving average’. I’m looking for the algorithm, but you can specify it in c++. Ideally, it would not involve a thread (i.e., being continuously refreshed, say every second) but rather be only evaluated when the value is asked.
How could I estimate the instantaneous throughput ? For example, in a way similar
Share
You can use an exponential moving average, as explained here, but I’ll repeat the formula:
To achieve an estimation, suppose you intend to query the computation every second, but you want an average over the last minute. Then, here would be one way to get that estimate:
You should actually use a monotonic clock instead of
time.