> For the complete documentation index, see [llms.txt](https://docs.datasentinel.io/manual/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.datasentinel.io/manual/ai-connector/analyze-and-tune-workloads/analyze-a-workload.md).

# Analyze a workload over a time window

Explain what happened on one instance during a past time window: session load, waits, top queries, hot tables, and blocking, in one read.

Something happened on an instance last night, this morning, or during a batch, and you want to know what. Name the instance and the window, and the assistant reads the whole period in one pass: how loaded the instance was, what the sessions were waiting on, which queries and tables were behind it, and whether anything was blocked. This is the starting point most other analyses branch from.

**Example prompts:**

* **Explain a window:**
  * "What ran on prod-eu-2 today between 1:30 and 2:30 am?"
  * "Why was prod-eu-1 slow this afternoon around 2:10?"
  * "Do a full analysis of prod-eu-1 for yesterday's nightly batch."

## What the analysis shows

The assistant asks you to confirm the instance and the time window (24 hours at most) before it calls the platform. It then collects session activity, query statistics, blocking scenarios, and table activity for that window together, and reads them against each other rather than one at a time.

The result opens with a few key points, then explains the window section by section:

The pressure shape is named in plain language ("the window was I/O-bound: reads from table data files dominate"), and the next steps offered at the end follow from it. An I/O-bound window leads to an I/O drill-down, a lock-bound window to the blocking analysis, a CPU-bound window to the top offender's execution plan.

{% @arcade/embed url="<https://app.arcade.software/share/tGyPO8nAQdYCoROmemgq>" flowId="tGyPO8nAQdYCoROmemgq" %}

*This walkthrough was recorded with the ChatGPT Desktop app.*

{% hint style="info" %}
When every metric comes back empty, the assistant does not write an empty report. It tells you the instance looked idle, offers to widen the window, and checks the monitoring annotations to rule out a collection gap.
{% endhint %}

## Where to go next

At the end of every analysis, the assistant proposes a few next actions to choose from, picked according to what the workload showed. The usual branches are:

* One query stands out: [Optimize your top queries](/manual/ai-connector/analyze-and-tune-workloads/optimize-top-queries.md).
* Sessions were waiting on locks: [Investigate a blocking scenario](/manual/ai-connector/analyze-and-tune-workloads/investigate-blocking-scenarios.md).
* The window looks worse than usual: [Investigate a workload regression](/manual/ai-connector/analyze-and-tune-workloads/investigate-workload-regression.md).
* The instance is slow right now, not in the past: [Diagnose a live performance spike](/manual/ai-connector/analyze-and-tune-workloads/diagnose-live-spike.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.datasentinel.io/manual/ai-connector/analyze-and-tune-workloads/analyze-a-workload.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
