Create a free ticket and our support team will provide you necessary assistance.
In this guide, we’ll explain how to retrieve and interpret statistical data from the Storm JavaScript Library. This includes bandwidth measurements, buffer metrics, and real-time performance charts.
Bandwidth metrics refer to the currently measured throughput used by the library to download audio and video data. The following parameters are available:
The average bandwidth usage currently measured, reported in bytes per second.
let currBandwidth = storm?.getBandwidthMeter()?.currentBandwidth ?? "0";
The lowest measured bandwidth value recorded within the last 5 seconds.
let minBandwidth = storm?.getBandwidthMeter()?.minBandwidth ?? "0";
The highest measured bandwidth value recorded within the last 5 seconds.
let maxBandwidth = storm?.getBandwidthMeter()?.maxBandwidth ?? "0";
Indicates the current stability trend of the bandwidth. Possible values are:
let bwStabilityTrendLabel = storm?.getBandwidthAnalyser()?.currentTrend;
Indicates the duration (in seconds) for which the current trend has been active.
let bwStabilityTrendDuration = storm?.getBandwidthAnalyser()?.trendDuration ?? 0;
The buffer represents the amount of preloaded audio-video data, measured in seconds, available on the user’s device. A safe buffer is typically around 200–300 milliseconds. Storm JavaScript Library allows full configuration of buffer size thresholds, playback start logic, buffering behavior, and even buffer trimming via playback acceleration.
The current size of the buffer, in seconds.
let bufferSize = storm?.getBufferAnalyser()?.bufferSize ?? "0";
Describes the current health of the buffer. Possible values are:
let bufferStabilityLabel = storm?.getBufferAnalyser()?.stability ?? "unknown";
Standard deviation of recent buffer measurements. Lower values indicate a more stable buffer.
let bufferStabilityDev = storm?.getBufferAnalyser()?.bufferDeviation ?? 0;
The Storm JavaScript Library can generate real-time charts to monitor buffer size, stability, and bandwidth consumption.
Available Graphs:
Visualizes the buffer size (same as Buffer Size described above).
storm.createBufferGraph
Shows buffer stability over time (same as Buffer Stability Label).
storm.createBufferStabilityGraph
Visualizes current bandwidth consumption (same as Current Bandwidth).
storm.createBandwidthGraph
To render a graph, attach it to a DOM element with defined dimensions (width and height), set the refresh interval in milliseconds, and call the start() method. To stop the graph and its internal timer, use stop().
const graph1 = storm.createBufferGraph("graph1", 50).start();
// Later, to stop the graph:
graph1.stop();
Create a free ticket and our support team will provide you necessary assistance.