Class: Conversant::V3::Services::CDN::Dashboard
- Inherits:
-
Object
- Object
- Conversant::V3::Services::CDN::Dashboard
- Defined in:
- lib/conversant/v3/services/cdn/dashboard.rb
Overview
Dashboard service for CDN quick metrics
Provides daily aggregated metrics for bandwidth and volume suitable for dashboard displays and quick overviews.
Instance Attribute Summary collapse
-
#parent ⇒ CDN
readonly
The parent CDN service instance.
Instance Method Summary collapse
-
#bandwidth(payload) ⇒ Hash
Get daily bandwidth metrics.
-
#initialize(parent) ⇒ Dashboard
constructor
Initialize dashboard service.
-
#volume(payload) ⇒ Hash
Get daily volume metrics.
Constructor Details
#initialize(parent) ⇒ Dashboard
Initialize dashboard service
38 39 40 |
# File 'lib/conversant/v3/services/cdn/dashboard.rb', line 38 def initialize(parent) @parent = parent end |
Instance Attribute Details
#parent ⇒ CDN (readonly)
Returns the parent CDN service instance.
33 34 35 |
# File 'lib/conversant/v3/services/cdn/dashboard.rb', line 33 def parent @parent end |
Instance Method Details
#bandwidth(payload) ⇒ Hash
Get daily bandwidth metrics
66 67 68 69 70 71 72 |
# File 'lib/conversant/v3/services/cdn/dashboard.rb', line 66 def bandwidth(payload) response = @parent.send(:call, 'POST', '/api/report/bandwidth/day', payload) JSON.parse(response) rescue StandardError => e @parent.send(:logger).error "#{@parent.send(:identifier)}.METHOD:dashboard.bandwidth.EXCEPTION:#{e.}" nil end |
#volume(payload) ⇒ Hash
Get daily volume metrics
98 99 100 101 102 103 104 |
# File 'lib/conversant/v3/services/cdn/dashboard.rb', line 98 def volume(payload) response = @parent.send(:call, 'POST', '/api/report/volume/day', payload) JSON.parse(response) rescue StandardError => e @parent.send(:logger).error "#{@parent.send(:identifier)}.METHOD:dashboard.volume.EXCEPTION:#{e.}" nil end |