1
0
Fork 0
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:
Kevin Olbrich 2013-12-12 18:25:31 +00:00
parent 1118bc5420
commit fc8ec4e6e8
5 changed files with 27 additions and 1 deletions

View file

@ -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|

View file

View 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

View file

@ -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