Hi,
I’m new to Dynatrace and DQL, and I’d appreciate some advice. I’d like to calculate a ratio between two metrics (avg(read_time) / avg(write_time)) and display it as a single value in the Dynatrace SaaS Dashboards App.
Is this possible, and what’s the correct way to do it?
Please try this DQL and see if this is what you are trying to achieve:
This is a time series showing the ratio of average disk write time to average disk read time over time, with the intermediate metrics removed for clarity.
Current update:
__________________________
timeseries {
write_time = avg(dt.host.disk.write_time),
read_time = avg(dt.host.disk.read_time)
}
| fieldsAdd wt = arrayAvg(write_time), rt = arrayAvg(read_time)
| fieldsAdd ratio = concat(tostring(toLong(wt)), “:”, tostring(toLong(rt)))
| fieldsKeep ratio
_____________________
I extended the logic to convert the metric outputs into scalar values suitable for a single value tile. I also included a string-based ratio format