Skip to content

One health widget of the Analytics page

GET
/v1/analytics/health/{widget}
curl --request GET \
--url 'https://beta-api.plune.ai/v1/analytics/health/example?flaky=1&muted=1&notRunDays=30' \
--header 'Authorization: Bearer <token>'

A widget of the Health section of the Analytics page (#1260, epic #1242). Every widget answers the same wrapper — n of N (denominator), the rows behind it, whether they were cut, and what could not be measured. The filter is the one of GET /v1/analytics, and so is the reach: a session reads the projects projects names, a bearer token its own project only. A name that is not a widget is a 404. The page asks once per widget on every change of a filter, so the route has a ceiling of its own: 300 requests a minute per caller, over it 429 with Retry-After. ever_failing — the cases that fail every time: three verdicts or more, every one a failure (the rule of GET /v1/test-cases?health=ever_failing). denominator: n such cases of N — the cases with a pair of verdicts to score, the scored of GET /v1/analytics, so it reads beside the flaky ones («sometimes»). items: up to 20, the longest histories first, { caseId, title, projectId, runs, failures, lastFailedAt }; truncated when there are more. The state now: from and to are ignored. notMeasured says flaky_unscored for the live cases without a pair of verdicts. slowest — the cases that take the longest in the period (from..to, started_at of the runs; with no from the last 90 days, said in notMeasured as period_capped). n of N: the cases whose p95 duration (results.duration_ms) is above the threshold — thresholdMs, or the p95 of all measured results of the own project of the case in the period — of the cases with at least one measured duration. items: up to 20 by p95 descending, { caseId, title, projectId, p50Ms, p95Ms, thresholdMs, runs }; truncated when there are more. A result with no duration is not measured: notMeasured says no_duration with how many of how many, and it is never counted as zero. failures_by_message — the failed results of the period (from..to, started_at of the runs) grouped by their message: failure.headline, else the first line of the error context, normalised as a run’s failure groups are (numbers and quoted values do not split a group). n of N results: the failed or broken results (a muted case’s are not failures) in the groups shown, of all of them. items: up to 20 groups by count descending, { message, count, cases, firstRunId, firstRunProjectId, firstResultId, lastSeenAt } (the first run of the group in the period, with its result); truncated when there are more groups. A failed result with no message is not in a group: notMeasured says failure_no_message with how many of how many. Messages can hold data from tests: they are shown to people who can read the project’s results, as every answer of this route. detached — the cases whose test left the code (state detached): n of N cases, the live manual and automated cases that are not deprecated. items: up to 20, the most recently detached first, { caseId, title, projectId, reason, detachedAt } (reason and detachedAt are the case’s stateReason and stateChangedAt, null when unset); truncated when there are more. The state now: from and to are ignored. cost — what automation spent in the period (from..to, started_at of the runs; with no from the last 90 days, period_capped): the evals’ model calls, priced from the usage of every row of the stored plune sync result, and the project’s AI features (drafts, cases from text, requirements read from a document — what the monthly AI limit counts, by created_at). n of N runs: the runs that spent of the runs of the period. items: up to 3 runs, { runId, projectId, title, kind, startedAt, usd, unknownTokens, tokens, durationMs } — a run with a price nobody knows first, then by usd, then the newest; truncated when the period has more runs. extra: { usd, evalsUsd, aiFeaturesUsd, unknownTokens, evalsUnknownTokens, aiFeaturesUnknownTokens, partlyPricedRuns, usdPerMinute, manualRuns, noModelRuns, cachedRuns, cases, casesTotal } — noModelRuns the runs that are not manual and spent no tokens, cachedRuns those whose tokens all came from the cache; cases up to 3 eval cases by the cost of their rows, { caseId, title, projectId, usd, unknownTokens, runs, rows }, of casesTotal (two live cases with one evalId: the oldest). A price nobody knows is never $0: an eval row with tokens, cost_usd 0 and not from the cache, or an AI feature with tokens and no cost, is counted in unknownTokens, never in usd. usdPerMinute is the evals’ dollars over their minutes, of the runs priced whole; null with none. The run filters narrow the evals only; the AI features belong to no run and are counted for the whole project, said in notMeasured as ai_features_unfiltered. The case filters narrow cases only, said as cost_case_filters_list_only.

widget
required
string

The widget’s name.

from
string format: date-time

The start of the period, inclusive — ISO 8601 with a time zone. Only the widgets that describe a period read it; the others describe the state now.

to
string format: date-time

The end of the period, inclusive, as from.

projects
Array<string>
<= 100 items

Project ids, comma-separated — as on GET /v1/analytics. One you are not in, or one in the bin, is a 404.

labels
Array<string>

Run labels. Repeat for any-of.

tags
Array<string>

Case tags, verbatim and without @. Repeat for any-of.

environments
Array<string>

Run environments. Repeat for any-of.

executedBy
Array<string>

People, by userId — comma-separated or repeated.

suite
string

A suite, or a folder with everything beneath it — only with exactly one project in the request.

flaky
string
Allowed values: 1 true 0 false

The case flag isFlaky, as on GET /v1/analytics.

muted
string
Allowed values: 1 true 0 false

The case flag isMuted, as on GET /v1/analytics.

notRunDays
integer
default: 30 >= 1 <= 365

Widget never_run only (#1260): how many days back it looks for a result; the same bounds and the same 400 as notRunDays on GET /v1/test-cases. Other widgets ignore it.

thresholdMs
integer
>= 1 <= 86400000

Widget slowest only (#1260): the duration in milliseconds the p95 of a case must exceed; absent, the p95 of the own project of the case in the period. Outside 1..86400000 is a 400 that names the parameter. Other widgets ignore it.

The widget

Media type application/json
object
widget
required

The name in the path.

string
denominator
required

n of N units. N = 0 is «no data»; n = 0 with N > 0 is the good state — no row is not a gap.

object
n
required
integer
N
required
integer
unit
required

What is counted, a word — cases, suites, results.

string
items
required

The rows behind n; their shape is the widget’s own. May be cut — see truncated.

Array<object>
object
key
additional properties
any
truncated
required

true: more rows than items holds; denominator.n is still the whole count.

boolean
extra

A widget’s own figures beside the rows, in its own shape; only cost sends it (#1261).

object
key
additional properties
any
notMeasured
required

What the widget could not measure, as the notMeasured of GET /v1/analytics: a code, its numbers and the projects it names. [] — everything was measured.

Array<object>
object
code
required
string
params
object
key
additional properties
integer
projects
Array<string>
Example generated
{
"widget": "example",
"denominator": {
"n": 1,
"N": 1,
"unit": "example"
},
"items": [
{}
],
"truncated": true,
"extra": {},
"notMeasured": [
{
"code": "example",
"params": {
"additionalProperty": 1
},
"projects": [
"example"
]
}
]
}

A filter GET /v1/analytics would refuse, with the same message

Media type application/json
object
error
required
string
Example generated
{
"error": "example"
}

No / invalid token or session

A widget that does not exist, or a project you are not a member of or one in the bin — the same answer as an id nobody has

Media type application/json
object
error
required
string
Example
{
"error": "not found"
}

Rate-limited: the per-route throttle, or the per-minute request limit of the plan an API token counts by (#1442; the body names the plan, #2092). Retry-After carries the seconds until the window rolls over.

Media type application/json
object
error
required
string
Example generated
{
"error": "example"
}
Retry-After
integer

Seconds until the window rolls over