# Timelion / how to get a number of bytes per second

**URL:** <https://discuss.elastic.co/t/timelion-how-to-get-a-number-of-bytes-per-second/55986>\
**Category:** Kibana\
**Tags:** timelion\
**Created:** [July 20, 2016, 1:40pm UTC](https://discuss.elastic.co/t/timelion-how-to-get-a-number-of-bytes-per-second/55986 "2016-07-20T13:40:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![TRSRaphael](https://avatars.discourse-cdn.com/v4/letter/t/3e96dc/32.png) [@TRSRaphael](https://discuss.elastic.co/u/TRSRaphael)\
**Post date:** [July 20, 2016, 1:40pm UTC](https://discuss.elastic.co/t/timelion-how-to-get-a-number-of-bytes-per-second/55986/1 "2016-07-20T13:40:00Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [July 21, 2016, 7:48am UTC](https://discuss.elastic.co/t/timelion-how-to-get-a-number-of-bytes-per-second/55986/2 "2016-07-21T07:48:36Z")

</div>

You should be able to use the [scale\_interval function](https://github.com/elastic/timelion/blob/master/server/series_functions/scale_interval.js) to achieve this.

---

<div class="post-metadata">

**Author:** ![TRSRaphael](https://avatars.discourse-cdn.com/v4/letter/t/3e96dc/32.png) [@TRSRaphael](https://discuss.elastic.co/u/TRSRaphael)\
**Post date:** [July 21, 2016, 2:39pm UTC](https://discuss.elastic.co/t/timelion-how-to-get-a-number-of-bytes-per-second/55986/3 "2016-07-21T14:39:18Z")

</div>

Thank you.  
I should do : .es('my\_query').scale\_interval(1s)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 1:45pm UTC](https://discuss.elastic.co/t/timelion-how-to-get-a-number-of-bytes-per-second/55986/4 "2017-07-06T13:45:16Z")

</div>


