Sha256: 6096ff95d85045769d56385047684cafd778ef5c5644471922d52bc8bc5a1462

Contents?: true

Size: 1.39 KB

Versions: 38

Compression:

Stored size: 1.39 KB

Contents

#!/usr/bin/env ruby

require 'mux_ruby'
require 'solid_assert'

SolidAssert.enable_assertions

# Authentication Setup
openapi = MuxRuby.configure do |config|
  config.username = ENV['MUX_TOKEN_ID']
  config.password = ENV['MUX_TOKEN_SECRET']
end

# API Client Initialization
metrics_api = MuxRuby::MetricsApi.new

# ========== list-breakdown-values ==========
breakdown = metrics_api.list_breakdown_values('video_startup_time', {:group_by => 'browser', :timeframe => ['7:days']})
assert breakdown != nil
assert breakdown.data != nil
puts "list-breakdown-values OK ✅"

# ========== get-overall-values ==========
overall = metrics_api.get_overall_values('video_startup_time', {:timeframe => ['7:days']})
assert overall != nil
assert overall.data != nil
puts "get-overall-values OK ✅"

# ========== list-insights ==========
insights = metrics_api.list_insights('video_startup_time', {:timeframe => ['7:days']})
assert insights != nil
assert insights.data != nil
puts "list-insights OK ✅"

# ========== get-metric-timeseries-data ==========
timeseries = metrics_api.get_metric_timeseries_data('video_startup_time', {:timeframe => ['7:days']})
assert timeseries != nil
assert timeseries.data != nil
puts "get-metric-timeseries-data OK ✅"

# ========== list-all-metric-values ==========
values = metrics_api.list_all_metric_values()
assert values != nil
assert values.data != nil
puts "list-all-metric-values OK ✅"

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
mux_ruby-3.20.0 examples/data/exercise-metrics.rb
mux_ruby-3.19.0 examples/data/exercise-metrics.rb
mux_ruby-3.18.0 examples/data/exercise-metrics.rb
mux_ruby-3.17.0 examples/data/exercise-metrics.rb
mux_ruby-3.15.0 examples/data/exercise-metrics.rb
mux_ruby-3.14.0 examples/data/exercise-metrics.rb
mux_ruby-3.13.0 examples/data/exercise-metrics.rb
mux_ruby-3.12.0 examples/data/exercise-metrics.rb
mux_ruby-3.11.1 examples/data/exercise-metrics.rb
mux_ruby-3.11.0 examples/data/exercise-metrics.rb
mux_ruby-3.9.0 examples/data/exercise-metrics.rb
mux_ruby-3.8.0 examples/data/exercise-metrics.rb
mux_ruby-3.7.0 examples/data/exercise-metrics.rb
mux_ruby-3.6.0 examples/data/exercise-metrics.rb
mux_ruby-3.5.2 examples/data/exercise-metrics.rb
mux_ruby-3.5.1 examples/data/exercise-metrics.rb
mux_ruby-3.5.0 examples/data/exercise-metrics.rb
mux_ruby-3.4.0 examples/data/exercise-metrics.rb
mux_ruby-3.3.1 examples/data/exercise-metrics.rb
mux_ruby-3.3.0 examples/data/exercise-metrics.rb