Skip to content

API reference / @jsprismarine/client / Samples

Class: Samples ​

Defined in: client/src/bot/Metrics.ts:10

A stream of measurements, kept in full so percentiles are exact.

Every sample is retained rather than bucketed. A load run takes a bounded number of them - one login latency per bot, not one per packet - and an approximate p99 from a histogram is exactly the number somebody would later want to be sure about.

Constructors ​

Constructor ​

new Samples(): Samples

Returns ​

Samples

Accessors ​

count ​

Get Signature ​

get count(): number

Defined in: client/src/bot/Metrics.ts:17

Returns ​

number

Methods ​

add() ​

add(value): void

Defined in: client/src/bot/Metrics.ts:13

Parameters ​

value ​

number

Returns ​

void


max() ​

max(): number | null

Defined in: client/src/bot/Metrics.ts:37

Returns ​

number | null


mean() ​

mean(): number | null

Defined in: client/src/bot/Metrics.ts:41

Returns ​

number | null


min() ​

min(): number | null

Defined in: client/src/bot/Metrics.ts:33

Returns ​

number | null


percentile() ​

percentile(p): number | null

Defined in: client/src/bot/Metrics.ts:25

The p-th percentile by nearest rank, or null with nothing to report.

Parameters ​

p ​

number

between 0 and 1.

Returns ​

number | null


summary() ​

summary(): LatencySummary

Defined in: client/src/bot/Metrics.ts:47

Returns ​

LatencySummary