Skip to content

bmel:percentile-latency

Category: Array & Statistics · Returns: bmel:number

Signature
bmel:percentile-latency(latencies: bmel:array<number>, p: bmel:number)

Description

Returns the p-th percentile latency from an array of latency measurements (in milliseconds). Semantically equivalent to bmel:percentile-of but named for the LLM observability context where p99, p95, and p50 are the canonical SLA metrics. p must be between 0 and 100 inclusive.

Arguments

Parameter Type Required Description
latencies bmel:array<number> Array of latency measurements in milliseconds.
p bmel:number Percentile to compute (0–100). Common values: 50 (median), 95 (p95), 99 (p99).

Examples

p95 latency of the LLM calls of a run
bmel:percentile-latency({createChatCompletion:Response Payload[]}.$.latency_ms, 95)
p99 above one second
bmel:percentile-latency({createChatCompletion:Response Payload[]}.$.latency_ms, 99) > 1000

← Back to BMEL Reference