Feature request: I would like to access averaged peak speed data via macro.
Like that ui graph with speed peak. . . average of peaks, if made available by macro, would be so very useful in determining workload/capacity.
That is the missing piece of data for making pages adaptive to capacity.
you are not satisfied with just reading %speed-out% ?
maybe you want to make an average over 5 or 10 seconds?
you can make your own calculations by using events. Something like
[every 1 second]
do my calculation based on %speed-out% and store the result in a #global variable
then in your tpl you can just use that variable
It's not super-easy but it can be done.
if you want to average over 5 seconds you may do something like
{.set|#speedIdx|{.calc|({.^speedIdx.}+1)%5.}.}
{.set|#speedArray{.^#speedIdx.}|%speed-out%.}
{.for|i|0|4|{:{.inc|speedSum|0{.^#speedArray{.^i.}.}.}:}.}
{.set|#speedAverage|{.div|{.^speedSum.}|5.}.}
Did not test it any it may be full of bugs.
Commenting the lines
1. calculate where we are now (index)
2. store at that index the current speed
3 and 4. caculate the average of all the recorded speeds. The extra 0 for 'inc' is to avoid having an empty string when the array is empty, causing inc to default to 1 instead of zero.