Mux v3.2.1 Mux.Data.Metrics View Source

This module provides functions that interact with the metrics endpoints, which includes a bulk of the data product's statistical data.

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

Link to this section Summary

Functions

List the breakdown values for a specific metric.

List all of the values across every breakdown for a specific breakdown value.

Returns a list of insights for a metric. These are the worst performing values across all breakdowns sorted by how much they negatively impact a specific metric.

Returns the overall value for a specific metric, as well as the total view count, watch time, and the Mux Global metric value for the metric.

Returns time series data for a given metric.

Link to this section Functions

Link to this function

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

View Source

List the breakdown values for a specific metric.

Returns {:ok, breakdowns, raw_env}.

Examples

iex> client = Mux.client("my_token_id", "my_token_secret")
iex> {:ok, breakdowns, _env} = Mux.Data.Metrics.breakdown(client, "video_startup_time", "browser")
iex> breakdowns
[%{"field" => "mac", "negative_impact" => 1, "total_watch_time" => 7500, "value" => 3500, "views" => 3}, %{"field" => "windows", "negative_impact" => 2, "total_watch_time" => 3500, "value" => 1000, "views" => 2}]

iex> client = Mux.client("my_token_id", "my_token_secret")
iex> {:ok, breakdowns, _env} = Mux.Data.Metrics.breakdown(client, "video_startup_time", "browser", measurement: "median", timeframe: ["6:hours"])
iex> breakdowns
[%{"field" => "mac", "negative_impact" => 1, "total_watch_time" => 7500, "value" => 3500, "views" => 3}, %{"field" => "windows", "negative_impact" => 2, "total_watch_time" => 3500, "value" => 1000, "views" => 2}]
Link to this function

comparison(client, dimension, value, params \\ [])

View Source

List all of the values across every breakdown for a specific breakdown value.

Returns {:ok, comparisons, raw_env}.

Examples

iex> client = Mux.client("my_token_id", "my_token_secret")
iex> {:ok, comparison, _env} = Mux.Data.Metrics.comparison(client, "browser", "Safari")
iex> comparison
[%{"name" => "totals", "view_count" => 2, "watch_time" => 32000}, %{"metric" => "viewer_experience_score", "name" => "Overall Score", "type" => "score", "value" => 0.25}, %{"items" => [%{"metric" => "playback_failure_percentage", "name" => "Playback Failure Percentage", "type" => "percentage", "value" => 0}], "metric" => "playback_failure_score", "name" => "Playback Failure Score", "type" => "score", "value" => 1}, %{"items" => [%{"measurement" => "median", "metric" => "video_startup_time", "name" => "Video Startup Time (median)", "type" => "milliseconds", "value" => 1000}, %{"measurement" => "95th", "metric" => "video_startup_time", "name" => "Video Startup Time (95th %)", "type" => "milliseconds", "value" => 1000}, %{"measurement" => "median", "metric" => "player_startup_time", "name" => "Player Startup Time (median)", "type" => "milliseconds", "value" => nil}, %{"measurement" => "95th", "metric" => "player_startup_time", "name" => "Player Startup Time (95th %)", "type" => "milliseconds", "value" => nil}, %{"measurement" => "median", "metric" => "page_load_time", "name" => "Page Load Time (median)", "type" => "milliseconds", "value" => nil}, %{"measurement" => "95th", "metric" => "page_load_time", "name" => "Page Load Time (95th %)", "type" => "milliseconds", "value" => nil}, %{"measurement" => "median", "metric" => "aggregate_startup_time", "name" => "Aggregate Startup Time (median)", "type" => "milliseconds", "value" => nil}, %{"measurement" => "95th", "metric" => "aggregate_startup_time", "name" => "Aggregate Startup Time (95th %)", "type" => "milliseconds", "value" => nil}, %{"metric" => "seek_latency", "name" => "Seek Latency", "type" => "milliseconds", "value" => nil}, %{"metric" => "exits_before_video_start", "name" => "Exits Before Video Start", "type" => "percentage", "value" => 0}], "metric" => "startup_time_score", "name" => "Startup Time Score", "type" => "score", "value" => 1}, %{"items" => [%{"metric" => "rebuffer_percentage", "name" => "Rebuffer Percentage", "type" => "percentage", "value" => 0}, %{"metric" => "rebuffer_frequency", "name" => "Rebuffer Frequency", "type" => "per_minute", "value" => 13.125}, %{"measurement" => "median", "metric" => "rebuffer_duration", "name" => "Rebuffer Duration (median)", "type" => "milliseconds", "value" => 0}, %{"measurement" => "95th", "metric" => "rebuffer_duration", "name" => "Rebuffer Duration (95th %)", "type" => "milliseconds", "value" => 0}, %{"measurement" => "median", "metric" => "rebuffer_count", "name" => "Rebuffer Count (median)", "type" => "number", "value" => 2}, %{"measurement" => "95th", "metric" => "rebuffer_count", "name" => "Rebuffer Count (95th %)", "type" => "number", "value" => 5}], "metric" => "rebuffer_score", "name" => "Rebuffer Score", "type" => "score", "value" => 0.25}, %{"items" => [%{"measurement" => "median", "metric" => "upscale_percentage", "name" => "Upscale Percentage (median)", "type" => "percentage", "value" => nil}, %{"measurement" => "95th", "metric" => "upscale_percentage", "name" => "Upscale Percentage (95th %)", "type" => "percentage", "value" => nil}, %{"measurement" => "avg", "metric" => "upscale_percentage", "name" => "Upscale Percentage (average)", "type" => "percentage", "value" => nil}, %{"measurement" => "median", "metric" => "downscale_percentage", "name" => "Downscale Percentage (median)", "type" => "percentage", "value" => nil}, %{"measurement" => "95th", "metric" => "downscale_percentage", "name" => "Downscale Percentage (95th %)", "type" => "percentage", "value" => nil}, %{"measurement" => "avg", "metric" => "downscale_percentage", "name" => "Downscale Percentage (average)", "type" => "percentage", "value" => nil}, %{"measurement" => "median", "metric" => "max_upscale_percentage", "name" => "Max Upscale Percentage (median)", "type" => "percentage", "value" => nil}, %{"measurement" => "95th", "metric" => "max_upscale_percentage", "name" => "Max Upscale Percentage (95th %)", "type" => "percentage", "value" => nil}, %{"measurement" => "median", "metric" => "max_downscale_percentage", "name" => "Max Downscale Percentage (median)", "type" => "percentage", "value" => nil}, %{"measurement" => "95th", "metric" => "max_downscale_percentage", "name" => "Max Downscale Percentage (95th %)", "type" => "percentage", "value" => nil}], "metric" => "video_quality_score", "name" => "Video Quality Score", "type" => "score", "value" => nil}]
Link to this function

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

View Source

Returns a list of insights for a metric. These are the worst performing values across all breakdowns sorted by how much they negatively impact a specific metric.

Returns {:ok, insights, raw_env}.

Examples

iex> client = Mux.client("my_token_id", "my_token_secret")
iex> {:ok, insights, _env} = Mux.Data.Metrics.insights(client, "video_startup_time")
iex> insights
[%{"filter_column" => "country", "filter_value" => "US", "metric" => 4000, "negative_impact_score" => 0.6, "total_row_count" => 1, "total_views" => 5, "total_watch_time" => 10000}]
Link to this function

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

View Source

Returns the overall value for a specific metric, as well as the total view count, watch time, and the Mux Global metric value for the metric.

Returns {:ok, overall_values, raw_env}.

Examples

iex> client = Mux.client("my_token_id", "my_token_secret")
iex> {:ok, insights, _env} = Mux.Data.Metrics.overall(client, "video_startup_time")
iex> insights
%{"global_value" => nil, "total_views" => 3, "total_watch_time" => 3000, "value" => 0.8333333333333334}
Link to this function

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

View Source

Returns time series data for a given metric.

Returns {:ok, timeseries, raw_env}.

Examples

iex> client = Mux.client("my_token_id", "my_token_secret")
iex> {:ok, timeseries, _env} = Mux.Data.Metrics.timeseries(client, "video_startup_time")
iex> timeseries
[["2018-01-19T02:00:00.000Z", 0, 2], ["2018-01-19T03:00:00.000Z", 1, 3]]