> ## Documentation Index
> Fetch the complete documentation index at: https://docs.openlayer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Session record count

> Learn how to use the session record count test to monitor the number of records (turns) per session

## Definition

The session record count test monitors the **number of records** — typically turns —
per session. It's a numeric test (no LLM evaluator involved) that aggregates the row
count per session ID and lets you alert on pathological cases: runaway sessions with
hundreds of turns, or sessions that never went past one.

## Taxonomy

* **Task types**: LLM.
* **Availability**: development (Continuously evaluate your models and datasets as you iterate on their versions.)
  and monitoring (Monitor a model in production, measure its health, check for drifts and set up alerts.).
* **Evaluation level**: session.
* **Computation**: deterministic aggregation.

## Why it matters

* Runaway sessions (too many turns) often signal tool-call loops, clarification loops,
  or frustrated users hammering on the same question.
* Very short sessions (one turn then drop-off) may signal users bouncing off the
  product before the assistant could help.
* Track both tails — mean and percentile views of session length often tell very
  different stories.

## Available measurements

| Measurement | What it means |
| - | - |
| `totalSessions` | Number of sessions in the window |
| `meanRecordsPerSession` | Average number of records per session |
| `medianRecordsPerSession` | Median number of records per session |
| `stdRecordsPerSession` | Standard deviation of records per session |
| `minRecordsPerSession` | Shortest session in the window |
| `maxRecordsPerSession` | Longest session in the window |
| `p90RecordsPerSession` | 90th-percentile session length |
| `p95RecordsPerSession` | 95th-percentile session length |
| `p99RecordsPerSession` | 99th-percentile session length |
| `shortSessionCount` | Count of sessions below a short-session threshold |
| `mediumSessionCount` | Count of sessions in the medium-length band |
| `longSessionCount` | Count of sessions above a long-session threshold |

## Required columns

* **Session ID**: Groups turns belonging to the same conversation.

## Test configuration examples

```json Monitoring theme={null}
[
  {
    "name": "Mean records per session below 20",
    "description": "Alert when average session length exceeds 20 turns",
    "type": "performance",
    "subtype": "sessionRecordCount",
    "thresholds": [
      {
        "insightName": "sessionRecordCount",
        "measurement": "meanRecordsPerSession",
        "operator": "<=",
        "value": 20
      }
    ],
    "subpopulationFilters": null,
    "mode": "monitoring",
    "usesProductionData": true,
    "evaluationWindow": 3600,
    "delayWindow": 0
  }
]
```

## Related

* [Session duration](https://docs.openlayer.com/tests/catalog/session-duration.md) — wall-clock view of session length.
* [Session cost](https://docs.openlayer.com/tests/catalog/session-cost.md), [Session token count](https://docs.openlayer.com/tests/catalog/session-token-count.md) — cost and token aggregates per session.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.