Showing job-end-time and its sla time on graph

I need to show in graph - the time when job completed as compared to its SLA time (when the job is expected to complete).
I am thinking to post custom event once everyday having data like below :
[{
“eventType”:“batch_job”,
“name”: “abc”,
“folder”: “XYZ”,
“status”: “Ended OK”,
“startTime”: “10:25:57 PM”,
“upTime”: “10:27:00 PM”,
“slaTime”: “10:30:00 PM”
}, {
“eventType”:“batch_job”,
“name”: “def”,
“folder”: “XYZ”,
“status”: “Ended OK”,
“startTime”: “7:03:11 PM”,
“upTime”: “7:22:11 PM”,
“slaTime”: “7:30:00 PM”
}]
I need to query this custom event so that I could see upTime of job abc against its slaTime (sla time could be a static line as it won’t change and upTime would be actual time when job completed ) for the whole month.
Could anyone please help me with this problem statement .

If you are sending that also consider calculating the durations and sending that as well.

1 Like

Duration as in for endtime minus starttime of the job ?

Using timestamps is challenging. If you use durations in seconds for target and actual you can use math in NRQL to represent your results.

2 Likes