Multiply $_interval by a constant factor or get $MyTemplateInterval_ms

I’m using Grafana with Influxdb to help me understand the performance of the application that I’m developing and so far it’s proven to be fantastic.

The one thing I’m struggling with at the moment is that I want to scale my Y axis based on the interval, since I’m counting or summing per interval, but I don’t need single pixel resolution so I would like to multiply the interval by a constant factor.

Basically I want to do something like this:

SELECT sum( value) / ($__interval_ms * 10) FROM mymeasurement WHERE $timeFilter GROUP BY time( $__interval * 10)

(actually would like to set an interval scale factor to 10 and have grafana multiply the $__interval and $__interval_ms for me)

OR alternatively with an interval template variable (although not my first choice of solution):

SELECT sum( value) / $myInterval_ms FROM mymeasurement WHERE $timeFilter GROUP BY time( $myInterval)

Neither seems to be possible?

This would also be possible if Influxdb supported multiplying interval literals but it also doesn’t seem to be the case.

Use

SELECT sum( value) / ($__interval_ms) FROM mymeasurement WHERE $timeFilter GROUP BY time( $__interval)

Then specificy the higher interval in the group by time option below your queries, you can also use an interval variable in that field

Sorry I never followed up on this.

The suggested solution doesn’t meet my requirement because actually I want to scale the auto interval. The suggested solution would require changing the interval every time the selected time range changes.

Actually since I’d forgotten this I posted a new question:

https://localhost:3000/t/override-graph-resolution/12783