cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

DQL Dashboard - the average and maximum response times per 30 seconds

Gib80
Participant

Hi All, I have created a timeseries DQL for a dashboard and I have got so far and I'm now stuck. I need it to look like the attached image.

I need it to show the average and maximum response times (using the elapsed field), per 30 seconds on a graph.   Below is what I have so far, all I see in my results is one avg and max result (see attached image)

timeseries Response = avg(log.application),by: {elapsedMilliSeconds, content,event.original, application, actionname, sourcecontext, elapsed, timestamp, duration}
, interval:1m

| parse event.original, """LD '@t":' LD:time ',' """

| filter application == "API"
| filter actionname == "ScreeningResultController.Get (NBS.AML.Screening.API)"
| filter sourcecontext == "Serilog.AspNetCore."
| fields application, actionname, sourcecontext, toDouble(elapsed), timestamp, time, duration, elapsed, Response
| summarize round(avg(`toDouble(elapsed)`),decimals:2), round(max(`toDouble(elapsed)`),decimals:2)
| fieldsRename AvgSeconds=`round(avg(\`toDouble(elapsed)\`), decimals:2)`, MaxSeconds=`round(max(\`toDouble(elapsed)\`), decimals:2)`

 

 

 

3 REPLIES 3

Maheedhar_T
Advisor

Hey @Gib80 ,
Ideally for the line graph to work you need to have two sets of data one is timeframe and the other is the values in timeseries so that it can plot in graph format.
So your output must be having something similar to this.

Maheedhar_T_0-1728034741724.png

I could not replicate the exact thing, so I picked up CPU usage metric.
Also, above you have used avg of 'elapsed' metric which would convert the value from timeseries to a single value and ruins the whole purpose.

Hope this helps

Maheedhar

Thanks, that does make sense.  I'm not sure how to average the milliseconds on a timeseries..

You can use something like this if you are trying to plot max and average values for same metric.

timeseries `avg(dt.host.cpu.usage)` = avg(dt.host.cpu.usage), by: { host.name }, interval: 1m
| limit 1
| append [
timeseries `max(dt.host.cpu.usage)` = max(dt.host.cpu.usage), by: { host.name }
| limit 1
]

 

Maheedhar

Featured Posts