Class: Conversant::V3::Services::LMS::Partner::Analytics
- Inherits:
-
Object
- Object
- Conversant::V3::Services::LMS::Partner::Analytics
- Defined in:
- lib/conversant/v3/services/lms/partner/analytics.rb
Overview
LMS analytics service for partner-level reporting
Provides partner-level analytics and reporting for Live Media Streaming services including live duration, recording duration, transcoding metrics, and job statistics across multiple customer accounts.
Instance Attribute Summary collapse
-
#parent ⇒ Conversant::V3::Services::LMS
readonly
The parent LMS service instance.
Instance Method Summary collapse
-
#duration_of_live(params) ⇒ Hash
Get duration of live streaming for business usage reporting.
-
#duration_of_live_recording(params) ⇒ Hash
Get duration of live recording for business usage reporting.
-
#duration_v2_transcoding(params = {}) ⇒ Hash
Get transcoding duration metrics (v2 endpoint).
-
#durations(scope, params = {}) ⇒ Hash
Get duration metrics by scope (live/recording/transcoding).
-
#initialize(parent) ⇒ Analytics
constructor
Initialize partner LMS analytics service.
-
#jobs(params = {}) ⇒ Hash
Get transcoding job count metrics.
-
#no_of_live_jobs(params) ⇒ Hash
Get number of live streaming jobs for business usage reporting.
-
#recordings(params = {}) ⇒ Hash
Get recording duration metrics.
-
#transcodings(params = {}) ⇒ Hash
Get transcoding duration metrics.
Constructor Details
#initialize(parent) ⇒ Analytics
Initialize partner LMS analytics service
22 23 24 |
# File 'lib/conversant/v3/services/lms/partner/analytics.rb', line 22 def initialize(parent) @parent = parent end |
Instance Attribute Details
#parent ⇒ Conversant::V3::Services::LMS (readonly)
Returns the parent LMS service instance.
17 18 19 |
# File 'lib/conversant/v3/services/lms/partner/analytics.rb', line 17 def parent @parent end |
Instance Method Details
#duration_of_live(params) ⇒ Hash
Get duration of live streaming for business usage reporting
35 36 37 38 39 40 41 42 43 |
# File 'lib/conversant/v3/services/lms/partner/analytics.rb', line 35 def duration_of_live(params) params[:selectType] = 'ltd' query_string = params.map { |k, v| "#{k}=#{v}" }.join('&') response = @parent.send(:call, 'GET', "/v4/reporting/lms/business/usage/search?#{query_string}") JSON.parse(response) rescue StandardError => e @parent.send(:logger).error "#{@parent.send(:identifier)}.METHOD:#{__method__}.EXCEPTION:#{e.}" nil end |
#duration_of_live_recording(params) ⇒ Hash
Get duration of live recording for business usage reporting
54 55 56 57 58 59 60 61 62 |
# File 'lib/conversant/v3/services/lms/partner/analytics.rb', line 54 def duration_of_live_recording(params) params[:selectType] = 'rtd' query_string = params.map { |k, v| "#{k}=#{v}" }.join('&') response = @parent.send(:call, 'GET', "/v4/reporting/lms/business/usage/search?#{query_string}") JSON.parse(response) rescue StandardError => e @parent.send(:logger).error "#{@parent.send(:identifier)}.METHOD:#{__method__}.EXCEPTION:#{e.}" nil end |
#duration_v2_transcoding(params = {}) ⇒ Hash
Get transcoding duration metrics (v2 endpoint)
166 167 168 169 170 171 172 173 174 175 |
# File 'lib/conversant/v3/services/lms/partner/analytics.rb', line 166 def duration_v2_transcoding(params = {}) query_string = params.map { |k, v| "#{k}=#{v}" }.join('&') uri = '/v2/reporting/lms/transcoding/duration' uri += "?#{query_string}" unless query_string.empty? response = @parent.send(:call, 'GET', uri) JSON.parse(response) rescue StandardError => e @parent.send(:logger).error "#{@parent.send(:identifier)}.METHOD:#{__method__}.EXCEPTION:#{e.}" nil end |
#durations(scope, params = {}) ⇒ Hash
Get duration metrics by scope (live/recording/transcoding)
90 91 92 93 94 95 96 97 98 99 |
# File 'lib/conversant/v3/services/lms/partner/analytics.rb', line 90 def durations(scope, params = {}) query_string = params.map { |k, v| "#{k}=#{v}" }.join('&') uri = "/v2/reporting/lms/#{scope}/duration" uri += "?#{query_string}" unless query_string.empty? response = @parent.send(:call, 'GET', uri) JSON.parse(response) rescue StandardError => e @parent.send(:logger).error "#{@parent.send(:identifier)}.METHOD:#{__method__}.EXCEPTION:#{e.}" nil end |
#jobs(params = {}) ⇒ Hash
Get transcoding job count metrics
147 148 149 150 151 152 153 154 155 156 |
# File 'lib/conversant/v3/services/lms/partner/analytics.rb', line 147 def jobs(params = {}) query_string = params.map { |k, v| "#{k}=#{v}" }.join('&') uri = '/reporting/lms/transcoding/number' uri += "?#{query_string}" unless query_string.empty? response = @parent.send(:call, 'GET', uri) JSON.parse(response) rescue StandardError => e @parent.send(:logger).error "#{@parent.send(:identifier)}.METHOD:#{__method__}.EXCEPTION:#{e.}" nil end |
#no_of_live_jobs(params) ⇒ Hash
Get number of live streaming jobs for business usage reporting
73 74 75 76 77 78 79 80 81 |
# File 'lib/conversant/v3/services/lms/partner/analytics.rb', line 73 def no_of_live_jobs(params) params[:selectType] = 'ltn' query_string = params.map { |k, v| "#{k}=#{v}" }.join('&') response = @parent.send(:call, 'GET', "/v4/reporting/lms/business/usage/search?#{query_string}") JSON.parse(response) rescue StandardError => e @parent.send(:logger).error "#{@parent.send(:identifier)}.METHOD:#{__method__}.EXCEPTION:#{e.}" nil end |
#recordings(params = {}) ⇒ Hash
Get recording duration metrics
128 129 130 131 132 133 134 135 136 137 |
# File 'lib/conversant/v3/services/lms/partner/analytics.rb', line 128 def recordings(params = {}) query_string = params.map { |k, v| "#{k}=#{v}" }.join('&') uri = '/reporting/lms/recording/duration' uri += "?#{query_string}" unless query_string.empty? response = @parent.send(:call, 'GET', uri) JSON.parse(response) rescue StandardError => e @parent.send(:logger).error "#{@parent.send(:identifier)}.METHOD:#{__method__}.EXCEPTION:#{e.}" nil end |
#transcodings(params = {}) ⇒ Hash
Get transcoding duration metrics
109 110 111 112 113 114 115 116 117 118 |
# File 'lib/conversant/v3/services/lms/partner/analytics.rb', line 109 def transcodings(params = {}) query_string = params.map { |k, v| "#{k}=#{v}" }.join('&') uri = '/reporting/lms/transcoding/duration' uri += "?#{query_string}" unless query_string.empty? response = @parent.send(:call, 'GET', uri) JSON.parse(response) rescue StandardError => e @parent.send(:logger).error "#{@parent.send(:identifier)}.METHOD:#{__method__}.EXCEPTION:#{e.}" nil end |