05 Oct 2023
11:03 AM
- last edited on
08 Oct 2023
01:05 PM
by
MaciejNeumann
Hello,
I have the following DQL, which returns a time series of a metric "incoming count in last minute" from a custom extension/generic db query.
timeseries query=sum(custom.db.query), :interval:1m,
filter:{in(dt.entity.custom_device,classicEntitySelector("type(custom_device),entityName.equals(\"Incoming count in last 1 mins\")"))},
by:{dt.entity.custom_device}
What I'm after is for every minute, return the incoming count for the last 60 minutes, i.e. calculating the total count for the last 60 minutes, every minute.
I could define a db query and another metric to calculate this, but currently we're having performance/capacity issues so really don't want to add another custom db query when I should be able to derive the answer.
P.S. bins or increasing the interval, doesn't give me the granularity I need to compare against existing charts.
Thanks