Timelion / how to get a number of bytes per second

Hello,

I want to display a number of bytes par second by using TIMELION.
My query is based on a ElasticSearch datasource.

When I use the .derivative() function I will have : CURRENT VALUE - PREVIOUS VALUE.
To have a number per second I must divide this result by the interval used to get the values. The problem is that the user can change the interval.
Is there a way to get this value in the TIMELION expression input ?

For example the following query
.es('my_query').derivative().divide(5)
is correct with an interval of 5 seconds but wrong with any other interval

Regards,
Raphaël

1 Like

You should be able to use the scale_interval function to achieve this.

1 Like

Thank you.
I should do : .es('my_query').scale_interval(1s)

1 Like