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

**URL:** <https://community.dynatrace.com/t/dql-dashboard-the-average-and-maximum-response-times-per-30-seconds/48142>\
**Category:** DQL\
**Tags:** dql, logs\
**Created:** [October 4, 2024, 8:49am UTC](https://community.dynatrace.com/t/dql-dashboard-the-average-and-maximum-response-times-per-30-seconds/48142 "2024-10-04T08:49:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gib80](https://avatars.discourse-cdn.com/v4/letter/g/91b2a8/32.png) [@Gib80](https://community.dynatrace.com/u/Gib80)\
**Post date:** [October 4, 2024, 8:49am UTC](https://community.dynatrace.com/t/dql-dashboard-the-average-and-maximum-response-times-per-30-seconds/48142/1 "2024-10-04T08:49:45Z")

</div>

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.&nbsp; &nbsp;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)`

 ![Capture.PNG](https://global.discourse-cdn.com/dynatrace/original/3X/9/a/9a41ba11774e4c2e2bad798335fcfb61737d0f1e.png)  
 ![What I need it to look like.PNG](https://global.discourse-cdn.com/dynatrace/original/3X/7/0/70c757228aff5b423e706391b0a8d0bc63ab9a5e.png)

---

<div class="post-metadata">

**Author:** ![Maheedhar\_T](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/maheedhar_t/32/155_2.png) [@Maheedhar\_T](https://community.dynatrace.com/u/Maheedhar_T)\
**Post date:** [October 4, 2024, 9:43am UTC](https://community.dynatrace.com/t/dql-dashboard-the-average-and-maximum-response-times-per-30-seconds/48142/2 "2024-10-04T09:43:08Z")

</div>

Hey&nbsp;[@Gib80](https://community.dynatrace.com/user/76420)&nbsp;,  
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](https://global.discourse-cdn.com/dynatrace/original/3X/0/b/0bf9a592b2c174e11c9b139a608add6b5c0625ac.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

---

<div class="post-metadata">

**Author:** ![Gib80](https://avatars.discourse-cdn.com/v4/letter/g/91b2a8/32.png) [@Gib80](https://community.dynatrace.com/u/Gib80)\
**Post date:** [October 4, 2024, 10:04am UTC](https://community.dynatrace.com/t/dql-dashboard-the-average-and-maximum-response-times-per-30-seconds/48142/3 "2024-10-04T10:04:22Z")

</div>

Thanks, that does make sense.&nbsp; I’m not sure how to average the milliseconds on a timeseries..

---

<div class="post-metadata">

**Author:** ![Maheedhar\_T](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/maheedhar_t/32/155_2.png) [@Maheedhar\_T](https://community.dynatrace.com/u/Maheedhar_T)\
**Post date:** [October 4, 2024, 10:25am UTC](https://community.dynatrace.com/t/dql-dashboard-the-average-and-maximum-response-times-per-30-seconds/48142/4 "2024-10-04T10:25:29Z")

</div>

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

```markup
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
]

```
