RealTime
Extends:
Real-Time Class - Provides access to the Mux Data Real-Time API
Example:
const muxClient = new Mux(accessToken, secret);
const { Data } = muxClient;
// Returns a list of available real-time dimensions
Data.RealTime.dimensions();
Method Summary
Public Methods | ||
public |
Get breakdown information for a specific dimension and metric along with the number of concurrent viewers and negative impact score. |
|
public |
List of available real-time dimensions |
|
public |
histogramTimeseries(metricId: string, params: Object): Promise List histogram timeseries information for a specific metric |
|
public |
List available real-time metrics |
|
public |
timeseries(metricId: string, params: Object): Promise List timeseries information for a specific metric along with the number of concurrent viewers. |
Public Methods
public breakdown(metricId: string, params: Object): Promise source
Get breakdown information for a specific dimension and metric along with the number of concurrent viewers and negative impact score.
Params:
Name | Type | Attribute | Description |
metricId | string | The metric name/id for see https://api-docs.mux.com/#real-time-get-1 for a list of all metric ids |
|
params | Object | example { dimension: 'asn', timestamp: 1547853000, filters: ['operating_system:windows', 'country:US'] } |
Example:
const muxClient = new Mux(accessToken, secret);
const { Data } = muxClient;
// List the breakdown information for current-concurrent-viewers by ASN for a specific time for the Windows operating system in the US
Data.RealTime.breakdown('current-concurrent-viewers', { dimension: 'asn', timestamp: 1547853000, filters: ['operating_system:windows', 'country:US'] });
Test:
public dimensions(): Promise source
List of available real-time dimensions
Example:
const muxClient = new Mux(accessToken, secret);
const { Data } = muxClient;
// Returns a list of available real-time dimensions
Data.RealTime.dimensions();
public histogramTimeseries(metricId: string, params: Object): Promise source
List histogram timeseries information for a specific metric
Params:
Name | Type | Attribute | Description |
metricId | string | The metric name/id for see https://api-docs.mux.com/#real-time-get-1 for a list of all metric ids |
|
params | Object | example { filters: ['operating_system:windows', 'country:US'] } |
Example:
const muxClient = new Mux(accessToken, secret);
const { Data } = muxClient;
// List histogram timeseries information for video-startup-time for the Windows operating system in the US
Data.RealTime.histogramTimeseries('video-startup-time', { filters: ['operating_system:windows', 'country:US'] });
Test:
public metrics(): Promise source
List available real-time metrics
Example:
const muxClient = new Mux(accessToken, secret);
const { Data } = muxClient;
// Returns a list of available real-time metrics
Data.RealTime.metrics();
public timeseries(metricId: string, params: Object): Promise source
List timeseries information for a specific metric along with the number of concurrent viewers.
Params:
Name | Type | Attribute | Description |
metricId | string | The metric name/id for see https://api-docs.mux.com/#real-time-get-1 for a list of all metric ids |
|
params | Object | example { filters: ['operating_system:windows', 'country:US'] } |
Example:
const muxClient = new Mux(accessToken, secret);
const { Data } = muxClient;
// List timeseries information for the playback-failure-percentage metric along with the number of concurrent viewers for the Windows operating system in the US
Data.RealTime.timeseries('playback-failure-percentage', { filters: ['operating_system:windows', 'country:US'] });