Device Performance Metrics (CPU / Memory / Objects)
device_performance_metricsFetch time-series CPU, memory, and BrightScript object usage from Roku device performance charts. Includes optional process snapshot and downsampling for large windows.
Instructions
Time-series Device Performance metrics — the same chanperf/r2d2-bitmaps/app-object-counts data the Remote tab's CPU/Memory/BrightScript Objects quad charts poll and plot, returned as compact per-timestamp entries with a decoding legend. Requires "Show Device Performance" (quad layout) to have been turned on for this device tab at some point this session, with the sideloaded Dev channel as the foreground app — if it never was, devicePerformanceEnabled is false and samples is empty (never an error). charts selects which of cpu/memory/objects to include (default: all three) — each requested type appears as its own key per sample (c=cpu, m=memory, o=objects; see legend for field meanings). windowSec (default 60) sets how far back from now to report; if the device's retained history is shorter, actualWindowSec/sampleCount reflect what was actually available. A window whose natural sample count exceeds maxSamples (default 120, max 500) is evenly downsampled across the window (not truncated from one end) and downsampled is set true. cpuProcessSnapshot (only present when cpu is requested) is a single latest-value object (process state, channel uptime, CPU time, cumulative fault counts) — Roku's <proc-stat> block has no historical series of its own, only the fault-rate numbers inside each cpu sample do. Read-only.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| charts | No | Which chart types to include. Omit (or pass an empty array) for all three. | |
| device | No | Optional target device (IP or serial). Omit to use the focused tab. | |
| windowSec | No | How far back from now to report, in seconds (e.g. 60 for the last minute, 3600 for the last hour). Default 60. | |
| maxSamples | No | Cap on returned samples; the window is evenly downsampled if it would exceed this. Default 120, hard cap 500. |