Jump to content

'Windowed' reporting time average


craigt

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;

}

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...