lib/stream-stats-view
What both dashboards draw of lib/stream-stats.js's contract, kept free of
any framework so the two cannot read the same session differently: the four
status rows and what makes one a warning, the figures under the graphs, the
host meters, the geometry of a graph, and the plain-text report a user pastes
into an issue.
A row warns where the session fell short of what it asked for, never for a
choice and never for a server with no GPU, which is an ordinary deployment:
software encoding somebody selected, or on a host exposed no GPU, is neutral,
and software encoding on a session that asked for hardware where there is a
GPU is a warning and carries pixelflux's reason.
Technical values (NVENC, zero-copy, renderD128) are not translated; the
words a dashboard does translate arrive in words.
Interfaces
StreamRow
Defined in: lib/stream-stats-view.js:32
One status row.
Properties
key
key: "encoder" | "capture" | "decoder" | "connection";Defined in: lib/stream-stats-view.js:33
status
status: "good" | "warn" | "neutral";Defined in: lib/stream-stats-view.js:34
value
value: string;Defined in: lib/stream-stats-view.js:35
The headline.
detail
detail: string;Defined in: lib/stream-stats-view.js:36
The quieter second line, may be empty.
reason
reason: string;Defined in: lib/stream-stats-view.js:37
Why the row warns, empty unless it does.
StreamWords
Defined in: lib/stream-stats-view.js:41
The translated words the rows use.
Properties
hardware
hardware: string;Defined in: lib/stream-stats-view.js:42
software
software: string;Defined in: lib/stream-stats-view.js:43
unknown
unknown: string;Defined in: lib/stream-stats-view.js:44
throttled
throttled: string;Defined in: lib/stream-stats-view.js:45
Said when the server holds frames back.
StreamInfo
Defined in: lib/stream-stats.js:37
The server's description of the stream.
Properties
backend
backend: string;Defined in: lib/stream-stats.js:38
x11 or wayland.
capture
capture: string;Defined in: lib/stream-stats.js:39
The capture path: NvFBC, DRI3, XShm,
dmabuf or readback.
zero_copy
zero_copy: boolean;Defined in: lib/stream-stats.js:41
Whether frames reach the encoder without a copy.
capture_reason
capture_reason: string;Defined in: lib/stream-stats.js:42
Why not, empty where there is nothing to explain.
encoder
encoder: string;Defined in: lib/stream-stats.js:43
NVENC, VAAPI, or the software library.
hardware
hardware: boolean;Defined in: lib/stream-stats.js:44
Whether the encoder runs on a GPU.
gpu_present
gpu_present: boolean;Defined in: lib/stream-stats.js:45
Whether the server is exposed a GPU at all.
hardware_expected
hardware_expected: boolean;Defined in: lib/stream-stats.js:46
Whether the session asked for that on a server that has one.
encoder_reason
encoder_reason: string;Defined in: lib/stream-stats.js:48
Why it does not.
codec
codec: string;Defined in: lib/stream-stats.js:49
fullcolor
fullcolor: boolean;Defined in: lib/stream-stats.js:50
Whether the stream is 4:4:4.
striped
striped: boolean;Defined in: lib/stream-stats.js:51
gpu
gpu: string;Defined in: lib/stream-stats.js:52
The GPU a hardware session encodes on.
driver
driver: string;Defined in: lib/stream-stats.js:53
Its kernel driver.
encode_node
encode_node: string;Defined in: lib/stream-stats.js:54
Its render node.
renderer?
optional renderer?: string;Defined in: lib/stream-stats.js:55
Wayland only: gl or pixman.
render_node?
optional render_node?: string;Defined in: lib/stream-stats.js:56
render_gpu?
optional render_gpu?: string;Defined in: lib/stream-stats.js:57
renderer_reason?
optional renderer_reason?: string;Defined in: lib/stream-stats.js:58
StreamClient
Defined in: lib/stream-stats.js:62
This page's description of the stream.
Properties
transport
transport: "webrtc" | "websockets";Defined in: lib/stream-stats.js:63
decoder
decoder: "hardware" | "software" | "unknown";Defined in: lib/stream-stats.js:64
decoder_evidence
decoder_evidence: string;Defined in: lib/stream-stats.js:65
What that verdict rests on.
codec
codec: string;Defined in: lib/stream-stats.js:66
resolution
resolution: string;Defined in: lib/stream-stats.js:67
1920x1080.
path
path: string;Defined in: lib/stream-stats.js:68
WebRTC only: the candidate pair, as host udp.
sink
sink: string;Defined in: lib/stream-stats.js:69
How decoded frames reach the screen: a track
generator feeding a <video>, a canvas a worker composites on, or the
page's own canvas. Which one an engine allows is probed, so this is the
one that was taken rather than the one preferred.
decode_path
decode_path: string;Defined in: lib/stream-stats.js:73
JPEG only: what turns a stripe into a picture, and where it runs.
Type Aliases
StreamSample
type StreamSample = Object<string, number | boolean | string>;Defined in: lib/stream-stats.js:78
One second's
figures: the server's (cpu_percent, mem_used, mem_total,
gpu_percent, gpu_mem_used, gpu_mem_total, encoded_fps,
encode_ms, pipeline_ms, rtt_ms, throttled) where it sent them, this
page's (fps, mbps, and whatever else its core measures), and t, the
time in ms.
Type Parameters
| Type Parameter |
|---|
Variables
GRAPH_POINTS
const GRAPH_POINTS: 120 = 120;Defined in: lib/stream-stats-view.js:222
Points a graph draws at most; a longer history is bucketed down to it by maximum.
Functions
codecName()
function codecName(codec): string;Defined in: lib/stream-stats-view.js:51
Parameters
| Parameter | Type | Description |
|---|---|---|
codec | string | - |
Returns
string
nodeName()
function nodeName(path): string;Defined in: lib/stream-stats-view.js:53
Parameters
| Parameter | Type | Description |
|---|---|---|
path | string | - |
Returns
string
joined()
function joined(parts): string;Defined in: lib/stream-stats-view.js:55
Parameters
| Parameter | Type | Description |
|---|---|---|
parts | (string | false)[] | - |
Returns
string
encoderRow()
function encoderRow(info): StreamRow;Defined in: lib/stream-stats-view.js:61
Parameters
| Parameter | Type | Description |
|---|---|---|
info | StreamInfo | - |
Returns
captureRow()
function captureRow(info): StreamRow;Defined in: lib/stream-stats-view.js:80
Parameters
| Parameter | Type | Description |
|---|---|---|
info | StreamInfo | - |
Returns
decoderRow()
function decoderRow(client, words): StreamRow;Defined in: lib/stream-stats-view.js:102
Parameters
| Parameter | Type | Description |
|---|---|---|
client | StreamClient | - |
words | StreamWords | - |
Returns
connectionRow()
function connectionRow(
client,
latest,
words
): StreamRow;Defined in: lib/stream-stats-view.js:122
Parameters
| Parameter | Type | Description |
|---|---|---|
client | StreamClient | - |
latest | { } | - |
words | StreamWords | - |
Returns
streamRows()
function streamRows(
info,
client,
latest,
words
): StreamRow[];Defined in: lib/stream-stats-view.js:144
The four status rows, in display order.
Parameters
| Parameter | Type | Description |
|---|---|---|
info | StreamInfo | - |
client | StreamClient | - |
latest | { } | - |
words | StreamWords | - |
Returns
streamTiles()
function streamTiles(latest, transport): object[];Defined in: lib/stream-stats-view.js:178
The figures under the graphs: one fixed set per transport, so the layout holds still. A figure with nothing measured this second, an encode time on an idle screen, reads as a dash rather than leaving.
Parameters
| Parameter | Type | Description |
|---|---|---|
latest | { } | - |
transport | "webrtc" | "websockets" | - |
Returns
object[]
gib()
function gib(bytes): string;Defined in: lib/stream-stats-view.js:187
Parameters
| Parameter | Type | Description |
|---|---|---|
bytes | number | - |
Returns
string
streamMeters()
function streamMeters(latest): object[];Defined in: lib/stream-stats-view.js:199
The host meters: the utilizations first and the memories under them, so the bars read as one block rather than alternating with the figures. A utilization carries a bar, which is what a share of a whole reads well as; a memory pair carries its amounts as the figure and no bar, because how much of how much is what an operator needs and a bar leaves it to a hover no touch screen has. The GPU rows are left out where the server reads no GPU.
Parameters
| Parameter | Type | Description |
|---|---|---|
latest | { } | - |
Returns
object[]
seriesOf()
function seriesOf(history, key): number[];Defined in: lib/stream-stats-view.js:232
One series of a history, bucketed down to GRAPH_POINTS so a graph that has
grown for ten minutes costs what a short one does. A bucket keeps its
maximum, since a graph of a rate is read for its peaks.
Parameters
| Parameter | Type | Description |
|---|---|---|
history | object[] | - |
key | string | - |
Returns
number[]
graphPath()
function graphPath(
values,
width,
height,
max
): object;Defined in: lib/stream-stats-view.js:250
A graph's SVG geometry. The history grows from the left edge until it fills the width, the way it reads while the stats stay open.
Parameters
| Parameter | Type | Description |
|---|---|---|
values | number[] | - |
width | number | - |
height | number | - |
max | number | The value at the top edge. |
Returns
object
Path data for the stroke and the fill under it, and each point's coordinates.
line
line: string;area
area: string;xs
xs: number[];ys
ys: number[];streamReport()
function streamReport(
info,
client,
latest
): string;Defined in: lib/stream-stats-view.js:267
The session as plain text, for an issue or a chat.
Parameters
| Parameter | Type | Description |
|---|---|---|
info | StreamInfo | - |
client | StreamClient | - |
latest | { } | - |
Returns
string