A question about how to show the average rate per second


I have a number of documents, each document with information of number of bytes has been transferred.
Each document also has its timestamp.

I would like to show a metric that average the total bytes by time range specified by the user.

If user specify the time range "last 15 min", I would like to sum up the total bytes for all the documents timestamp in last 15 min range, and divide that total number with total seconds (15 *60 seconds in this case), and the label of this metric will be bytes/sec.

Is this a common problem that has solution already?

1 Like

What version of the stack are you using? The "Average Bucket" aggregation was added in 5.4 that will let you do just that: https://github.com/elastic/kibana/pull/10070

The configuration will look something like this, but my fields are a little different from yours:

1 Like

We are using Kibana 5.2

I checked with 5.4, as far as I understood, this won't work.

Even I am doing last 15 min, kibana will not take "Second" interval as bucket, and it automatically creates 5 seconds interval, which makes the rate to be per 5 seconds.

I wonder how other people deal with the network throughput type visualization.

I have a similar use case: I want to display a “transactions per second” (TPS) metric on a dashboard where the time range might vary widely; for example, from a few seconds to—conceivably, at a stretch—days. In this context, TPS is a count of documents per second (based on the @timestamp field), where each document represents a transaction.

I'm using Elastic 5.5.

Here's a screen cap from the viz editor:


Note the warning for the Interval value:

This interval creates too many buckets to show in the selected time range, so it has been scaled to 5 minutes.

How do I show TPS (documents per second) regardless of time range? Is this even feasible; am I asking too much? I understand that, with a long time range, this will involve counting millions of documents, and then dividing that total by the number of seconds in the time range. This “feels” like it should be possible (and without resorting to scripting), so I feel that I'm missing something (wouldn't be the first time :slightly_smiling_face:) or using the wrong approach.

This “single number” TPS metric doesn’t actually require any bucketing at all: just a count of documents divided by the number of seconds in the time range.

A related use case: I’d like a date histogram, with auto interval, of TPS. To get the chart values, for each bucket, Kibana would need to count the documents, and then divide by the number of seconds in the bucket. I can't figure out how to do that, either.


This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.