mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
metrics and fields
This commit is contained in:
parent
1118bc5420
commit
fc8ec4e6e8
5 changed files with 27 additions and 1 deletions
|
@ -27,6 +27,9 @@ module Fog
|
|||
collection :metrics
|
||||
model :metric
|
||||
|
||||
collection :fields
|
||||
model :field
|
||||
|
||||
class Mock
|
||||
def self.data
|
||||
@data ||= Hash.new do |hash, key|
|
||||
|
|
0
lib/fog/joyent/models/analytics/field.rb
Normal file
0
lib/fog/joyent/models/analytics/field.rb
Normal file
0
lib/fog/joyent/models/analytics/fields.rb
Normal file
0
lib/fog/joyent/models/analytics/fields.rb
Normal file
|
@ -4,8 +4,13 @@ module Fog
|
|||
module Joyent
|
||||
class Analytics
|
||||
class Metric < Fog::Model
|
||||
attribute :name
|
||||
attribute :module
|
||||
attribute :stat
|
||||
attribute :label
|
||||
attribute :interval
|
||||
attribute :fields
|
||||
attribute :unit
|
||||
attribute :type
|
||||
|
||||
end
|
||||
end
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
require 'fog/joyent/models/analytics/metric'
|
||||
|
||||
module Fog
|
||||
module Joyent
|
||||
class Analytics
|
||||
class Metrics < Fog::Collection
|
||||
|
||||
model Fog::Joyent::Analytics::Metric
|
||||
|
||||
def all
|
||||
data = service.describe_analytics.body['metrics']
|
||||
load(data)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Reference in a new issue