Reference Source Test
public class | source

RealTime

Extends:

* → RealTime

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();

Test:

Method Summary

Public Methods
public

breakdown(metricId: string, params: Object): Promise

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:

NameTypeAttributeDescription
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'] }

Return:

Promise

Returns a resolved Promise with a response from the Mux API

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:

See:

public dimensions(): Promise source

List of available real-time dimensions

Return:

Promise

Returns a resolved Promise with a response from the Mux API

Example:

const muxClient = new Mux(accessToken, secret);
const { Data } = muxClient;

// Returns a list of available real-time dimensions
Data.RealTime.dimensions();

See:

public histogramTimeseries(metricId: string, params: Object): Promise source

List histogram timeseries information for a specific metric

Params:

NameTypeAttributeDescription
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'] }

Return:

Promise

Returns a resolved Promise with a response from the Mux API

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:

See:

public metrics(): Promise source

List available real-time metrics

Return:

Promise

Returns a resolved Promise with a response from the Mux API

Example:

const muxClient = new Mux(accessToken, secret);
const { Data } = muxClient;

// Returns a list of available real-time metrics
Data.RealTime.metrics();

See:

public timeseries(metricId: string, params: Object): Promise source

List timeseries information for a specific metric along with the number of concurrent viewers.

Params:

NameTypeAttributeDescription
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'] }

Return:

Promise

Returns a resolved Promise with a response from the Mux API

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'] });

Test:

See: