Compare the average duration with previous calculations

Each night several test calculations are executed on our system and the results are logged to a database. e.g.

calculation 1 | 2022-12-15 | 5 sec.
calculation 1 | 2022-12-14 | 8 sec.
calculation 1 | 2022-12-13 | 6 sec.
calculation 2 | 2022-12-15 | 20 sec.
calculation 2 | 2022-12-14 | 14 sec.

I would like to display a graph showing the top 10 calculations that have performed slower than last time. This could be an indication that our new system performs slower compared to the previous version.

e.g. by comparing the average length of this week and compare this with the average length for the same type of calculations of last week.
e.g. by comparing the average lenght of this week and compare this with the average length for the same type of calculations of the last 4 weeks

What would be the best way to proceed with this?

Ivan

I would use a lag function.

This will get you the previous days measure

lag({seconds_field},[{date_field} ASC],[{calculation_field}])

Then you can do a subtraction on todays field and yesterdays.

You can group this to the week by using a truncDate on the date field.

And then you can also aggregate all of these measures.

That should get you want you need.

1 Like

Hi @Ivan_Eulaers

Did you try out the solution provided by @Max ? If it helped you resolve the question, please help the community by marking his answer as a “Solution.”

If we don’t hear back in the next 7 days, we will archive this question. Thanks!

1 Like

I didn’t find much info on the Lag-function. So it is unclear what this functions does.

Now, I’m looking at the periodOverPeriodDifference function as described in this blog: Period Functions Using Parameters