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 ) 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.