Upstash Documentation

$percentiles

1 min read

$percentiles returns percentile cut points for a field.

A percentile tells you the value below which a percentage of observations fall.

  • 50th percentile: median-like center point
  • 95th percentile: tail latency/price threshold
  • 99th percentile: extreme tail threshold

Compatibility#

Field TypeSupported
TEXTNo
U64/I64/F64Yes
DATEYes
BOOLNo
KEYWORDNo
FACETNo

Field must be FAST.

Arguments#

ArgumentTypeRequiredDescription
fieldstringYesField to aggregate.
percentsnumber[]NoPercent points to calculate (for example [50, 95, 99]).
keyedbooleanNoIf true (default), returns a map. If false, returns an array of { key, value }.
missingnumberNoFallback value for missing fields.

If percents is omitted, defaults to [1.0, 5.0, 25.0, 50.0, 75.0, 95.0, 99.0].

Output#

keyed: true (default):

keyed: false: