Jump to content

'Windowed' reporting time average


Recommended Posts

I would like to see the average reporting time displayed as a trend over the last couple hundred or so reports rather than an average over all reports. This would let me see what my reporting status is for the most recent set of reports.

I would suggest an IIR filter approach rather than a true window -- much less storage and calculation time. A possible implementation (in 'C' pseudo code) is


static float Coefficient = 0.02;

static float AverageReportingTime = 0.0;

uint ThisElapsedTime;

AverageReportingTime =

((1.0 - Coefficient) * AverageReportingTime) + (Coefficient * ThisElapsedTime);


The value for 'Coefficient' set around 0.02 would display a trend of the most recent hundred or so reports. This could be hard coded as a const or it could be listed in the preferences section although it would probably require a short tutorial to explain its meaning and range (0.0 to 1.0).

The storage size and exection time of the above should compare favorably with what (I assume) is currently employed


static ulong NumberOfReports = 0;

static ulong TotalElapsedTime = 0;

static uint AverageReportingTime = 0;

uint ThisElapsedTime;

AverageReportingTime =

(TotalElapsedTime += ThisElapsedTime) / ++NumberOfReports;


Edited by craigt
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...