# Extract the total time that CPU was in saturation for Data Explorer

**URL:** <https://community.dynatrace.com/t/extract-the-total-time-that-cpu-was-in-saturation-for-data-explorer/53584>\
**Category:** Dashboarding\
**Tags:** data-explorer, reports\
**Created:** [October 1, 2025, 8:53pm UTC](https://community.dynatrace.com/t/extract-the-total-time-that-cpu-was-in-saturation-for-data-explorer/53584 "2025-10-01T20:53:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Taz](https://avatars.discourse-cdn.com/v4/letter/t/3da27b/32.png) [@Taz](https://community.dynatrace.com/u/Taz)\
**Post date:** [October 1, 2025, 8:53pm UTC](https://community.dynatrace.com/t/extract-the-total-time-that-cpu-was-in-saturation-for-data-explorer/53584/1 "2025-10-01T20:53:08Z")

</div>

I am using the built in:

builtin:host.cpu.usage:splitBy(“dt.entity.host”):sort(value(auto,descending)):limit(20) which give me when the CPU goes to 100% but I want to know the duration of the event.

---

<div class="post-metadata">

**Author:** ![p\_devulapalli](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/p_devulapalli/32/41590_2.png) [@p\_devulapalli](https://community.dynatrace.com/u/p_devulapalli)\
**Post date:** [October 2, 2025, 12:04am UTC](https://community.dynatrace.com/t/extract-the-total-time-that-cpu-was-in-saturation-for-data-explorer/53584/2 "2025-10-02T00:04:21Z")

</div>

[@Taz](https://community.dynatrace.com/user/91747)&nbsp;Not sure you would be able to query the duration of event from Data explorer , but should be easy with Notebooks if you are on SaaS

```markup
fetch dt.davis.problems
| filter host.name == array("XYZ")
| filter event.name == "CPU saturation"
| fields host.name, event.name, resolved_problem_duration, display_id

```

---

<div class="post-metadata">

**Author:** ![t\_pawlak](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/t_pawlak/32/14991_2.png) [@t\_pawlak](https://community.dynatrace.com/u/t_pawlak)\
**Post date:** [October 10, 2025, 10:12am UTC](https://community.dynatrace.com/t/extract-the-total-time-that-cpu-was-in-saturation-for-data-explorer/53584/3 "2025-10-10T10:12:37Z")

</div>

If you start directly from the metric builtin:host.cpu.usage, you can’t really get the duration of an episode (bursts \> X%) in **Data Explorer**. Data Explorer evaluates values at individual time points, not continuous segments where a condition is true.

As&nbsp;[@p\_devulapalli](https://community.dynatrace.com/user/21657)&nbsp;write you have&nbsp;two practical approaches:  
Active (how long it has been open so far):

```markup
fetch dt.davis.problems
| filter event.kind == "DAVIS_PROBLEM"
| filter event.status == "ACTIVE"
| filter event.name == "CPU saturation"
| fields host.name, display_id, event.status, open_problem_duration

```

Closed (how long they lasted):

```markup
fetch dt.davis.problems
| filter event.kind == "DAVIS_PROBLEM"
| filter event.status == "CLOSED"
| filter event.name == "CPU saturation"
| fields host.name, display_id, event.status, resolved_problem_duration

```

### 2) Metric events / alerts

Create a **Metric event** (for example: “CPU \> 95% for ≥ 5 minutes”), and then query it later in Notebooks via dt.davis.events. Events have start and end times, so you can easily calculate each episode’s duration or total time within a window.

### Why not just Data Explorer?

Because a selector like:

```markup
builtin:host.cpu.usage:splitBy("dt.entity.host")

```

will only show values, but it won’t “stitch” consecutive points above a threshold into a single episode, nor return its length. For this type of analysis you need Problems/Events in DQL (or Notebooks), where you already have duration fields or can calculate now() - start\_time for active problems.
