Class: Conversant::V3::Services::VMS::Partner::Analytics
- Inherits:
-
Object
- Object
- Conversant::V3::Services::VMS::Partner::Analytics
- Defined in:
- lib/conversant/v3/services/vms/partner/analytics.rb
Overview
VMS analytics service for partner-level reporting
Provides partner-level analytics and reporting for Video Management System services including VOD duration and transcoding metrics across multiple customer accounts.
Instance Attribute Summary collapse
-
#parent ⇒ Conversant::V3::Services::VMS
readonly
The parent VMS service instance.
Instance Method Summary collapse
-
#business ⇒ Business
Get business service instance.
-
#duration(params = {}) ⇒ Array
Get VMS transcoding duration metrics.
-
#duration_of_vod(**args) ⇒ Array
Get duration of VOD (Video on Demand) for business usage reporting.
-
#initialize(parent) ⇒ Analytics
constructor
Initialize partner VMS analytics service.
Constructor Details
#initialize(parent) ⇒ Analytics
Initialize partner VMS analytics service
21 22 23 |
# File 'lib/conversant/v3/services/vms/partner/analytics.rb', line 21 def initialize(parent) @parent = parent end |
Instance Attribute Details
#parent ⇒ Conversant::V3::Services::VMS (readonly)
Returns the parent VMS service instance.
16 17 18 |
# File 'lib/conversant/v3/services/vms/partner/analytics.rb', line 16 def parent @parent end |
Instance Method Details
#business ⇒ Business
Get business service instance
Provides access to business-focused analytics that aggregate transcoding data for VOD billing and capacity planning.
37 38 39 |
# File 'lib/conversant/v3/services/vms/partner/analytics.rb', line 37 def business @business ||= Business.new(self) end |
#duration(params = {}) ⇒ Array
Get VMS transcoding duration metrics
Retrieves transcoding duration metrics for video processing operations, useful for capacity planning and billing calculations.
91 92 93 94 95 96 97 98 99 100 101 102 |
# File 'lib/conversant/v3/services/vms/partner/analytics.rb', line 91 def duration(params = {}) query_string = params.map { |k, v| "#{k}=#{v}" }.join('&') uri = '/reporting/vms/transcoding/duration' uri += "?#{query_string}" unless query_string.empty? response = @parent.send(:call, 'GET', uri) return [] if response.nil? JSON.parse(response)&.map(&:with_indifferent_access) || [] rescue StandardError => e @parent.send(:logger).error "#{@parent.send(:identifier)}.METHOD:#{__method__}.EXCEPTION:#{e.}" [] end |
#duration_of_vod(**args) ⇒ Array
Get duration of VOD (Video on Demand) for business usage reporting
Retrieves VOD transcoding duration metrics aggregated by month and customer type for partner-level business reporting and billing purposes.
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/conversant/v3/services/vms/partner/analytics.rb', line 57 def duration_of_vod(**args) month, type, = queries(**args) payload = { month: month, selectType: 'vtd', customerType: type, _: } response = @parent.send(:call, 'GET', "/v5/reporting/vms/business/usage/search?#{payload.to_query}") return [] if response.nil? JSON.parse(response)&.map(&:with_indifferent_access) || [] rescue StandardError => e @parent.send(:logger).error "#{@parent.send(:identifier)}.METHOD:#{__method__}.EXCEPTION:#{e.}" [] end |