20 May 2025 01:52 PM
Hi ,
I need help to built DQL to get process availability in % , Can somebody please help on this.
Regards,
Heramb Sawant
Solved! Go to Solution.
20 May 2025 05:06 PM
It requires getting all timeseries of availability state for process (in my example for process_group) and then calculating percentage of existence of availability state vs all states.
In my sample case it looks like this:
timeseries availability=sum(dt.process.availability), by:{availability.state, dt.entity.process_group}
, filter:in(dt.entity.process_group, {"PROCESS_GROUP-0517A6E81E811092"})
, interval:5m
| summarize { availability = 100*sum(if(availability.state=="available",availability[])) / sum(availability[])},
by: {interval, timeframe, dt.entity.process_group}
by executing this query you can look at the data behind:
timeseries availability=sum(dt.process.availability), by:{availability.state, dt.entity.process_group, dt.entity.process_group_instance}
, filter:in(dt.entity.process_group, {"PROCESS_GROUP-0517A6E81E811092"})
, interval:5m
there are 2 PGIs over time and at certain moment 2 of them become unavailable.
21 May 2025 08:07 AM - edited 21 May 2025 08:09 AM
@krzysztof_hoja top answer! every time your answers go into my bookmarks!
Just a quick note because until recently I didn't know it was possible to use a conditional function inside an aggregation function, until I tried it and hoped it would work.
Looking at the documentation, there's no such example and there's a countif() function while there's no sumif() or anything else. So it would be nice to have more examples of how to do conditional aggregations in the documentation. I've also recently had the same thought about the iCollectArray function, which is very powerful but not well reflected in the documentation because there aren't enough examples of its use.
21 May 2025 08:26 AM
I agree! Doc should contain more examples