Mux v1.9.0 Mux.Data.RealTime View Source

This module provides functions that interact with the real-time endpoints

Note, these API documentation links may break periodically as we update documentation titles.

Link to this section Summary

Functions

Get breakdown information for a specific dimension and metric along with the number of concurrent viewers and negative impact score.

List of available real-time dimensions

List histogram timeseries information for a specific metric

List of available real-time metrics

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

Link to this section Functions

Link to this function

breakdown(client, metric, params \\ [])

View Source

Get breakdown information for a specific dimension and metric along with the number of concurrent viewers and negative impact score.

Returns {:ok, breakdown, raw_env}.

Examples

iex> client = Mux.client("my_token_id", "my_token_secret")
iex> {:ok, breakdown, _env} = Mux.Data.RealTime.breakdown(client, "playback-failure-percentage", dimension: "country", timestamp: 1_547_853_000, filters: ["operating_system:windows"])
iex> breakdown
[%{"concurrent_viewers" => 1, "metric_value" => 0, "negative_impact" => 3, "value" => "AR"}]

List of available real-time dimensions

Returns {:ok, dimensions, raw_env}.

Examples

iex> client = Mux.client("my_token_id", "my_token_secret")
iex> {:ok, dimensions, _env} = Mux.Data.RealTime.dimensions(client)
iex> dimensions
[%{"display_name" => "ASN", "name" => "asn"}, %{"display_name" => "CDN", "name" => "cdn"}, %{"display_name" => "Country", "name" => "country"}, %{"display_name" => "Operating system", "name" => "operating_system"}, %{"display_name" => "Player name", "name" => "player_name"}, %{"display_name" => "Region / State", "name" => "region"}, %{"display_name" => "Stream type", "name" => "stream_type"}, %{"display_name" => "Sub property ID", "name" => "sub_property_id"}, %{"display_name" => "Video series", "name" => "video_series"}, %{"display_name" => "Video title", "name" => "video_title"}]
Link to this function

histogram_timeseries(client, metric, params \\ [])

View Source

List histogram timeseries information for a specific metric

Returns {:ok, histogram_timeseries, raw_env}.

Examples

iex> client = Mux.client("my_token_id", "my_token_secret")
iex> {:ok, histogram_timeseries, _env} = Mux.Data.RealTime.histogram_timeseries(client, "video-startup-time", filters: ["operating_system:windows", "country:US"])
iex> histogram_timeseries
[%{"average" => 1446.328947368421, "bucket_values" => [%{"count" => 19, "percentage" => 0.25}, %{"count" => 21, "percentage" => 0.27631578947368424}, %{"count" => 15, "percentage" => 0.19736842105263158}, %{"count" => 11, "percentage" => 0.14473684210526316}, %{"count" => 4, "percentage" => 0.05263157894736842}, %{"count" => 4, "percentage" => 0.05263157894736842}, %{"count" => 2, "percentage" => 0.02631578947368421}], "max_percentage" => 0.27631578947368424, "median" => 425, "p95" => 6809, "sum" => 76, "timestamp" => "2020-02-25T00:52:00Z"}]

List of available real-time metrics

Returns {:ok, metrics, raw_env}.

Examples

iex> client = Mux.client("my_token_id", "my_token_secret")
iex> {:ok, metrics, _env} = Mux.Data.RealTime.metrics(client)
iex> metrics
[%{"display_name" => "Current Concurrent Viewers (CCV)", "name" => "current-concurrent-viewers"}, %{"display_name" => "Current Rebuffering Percentage", "name" => "current-rebuffering-percentage"}, %{"display_name" => "Exits Before Video Start", "name" => "exits-before-video-start"}, %{"display_name" => "Playback Failure Percentage", "name" => "playback-failure-percentage"}, %{"display_name" => "Video Startup Time", "name" => "video-startup-time"}]
Link to this function

timeseries(client, metric, params \\ [])

View Source

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

Returns {:ok, timeseries, raw_env}.

Examples

iex> client = Mux.client("my_token_id", "my_token_secret")
iex> {:ok, timeseries, _env} = Mux.Data.RealTime.timeseries(client, "playback-failure-percentage", filters: ["operating_system:windows", "country:US"])
iex> timeseries
[%{"concurrent_viewers" => 477, "date" => "2020-02-25T00:51:45Z", "value" => 0.0597809346162238}, %{"concurrent_viewers" => 487, "date" => "2020-02-25T00:51:50Z", "value" => 0.059590005296620834}]