I’m trying to create a graph of normalized Throughput data. I have Throughput data points and I want to plot a graph of (Throughput / TotalThroughput) * 100, for any given period. I can use the Metric Script Field to apply a calculation to ‘_value’ (e.g. (_value / 6000000) * 100, given my TotalThroughput for the period is 6000000rpm), but the TotalThroughout will obviously change, based on the graph window.
Ideally, I need to be able to pick up, say, a Single Stat value for TotalThroughput dynamically and apply it to the Script Field as a variable, but I can’t see a way to do that! Another thought I had was to create a Template Variable that holds the TotalThroughput value, but I can’t see how to use a Template variable in the Script Field and have it interpreted before submitting the query. I know certain internal variables like ‘$interval’ and ‘$__interval_ms’ can be used in the field and they get interpreted before the query is submitted!
So, can I achieve what I need with Grafana? Can I reference dynamic variables or other metric values in the Metric Script Field?
My data source is Elasticsearch v5.4.0 and I’m using Grafana v4.6.0.