Class: Hawkular::Metrics::Client::Availability

Inherits:
Metrics
  • Object
show all
Defined in:
lib/hawkular/metrics/metric_api.rb

Overview

Class that interacts with “availability” metric types

Instance Method Summary collapse

Methods inherited from Metrics

#create, #encode_params, #get, #get_data_by_tags, #push_data, #query, #raw_data, #update_tags

Constructor Details

#initialize(client) ⇒ Availability

Returns a new instance of Availability

Parameters:



317
318
319
# File 'lib/hawkular/metrics/metric_api.rb', line 317

def initialize(client)
  super(client, 'availability', 'availability')
end

Instance Method Details

#get_data(id, starts: nil, ends: nil, bucketDuration: nil, buckets: nil, distinct: nil, limit: nil, order: nil) ⇒ Array[Hash]

Retrieve metric datapoints

Parameters:

  • id (String)

    metric definition id

  • starts (Integer)

    optional timestamp (default now - 8h)

  • ends (Integer)

    optional timestamp (default now)

  • buckets (Integer)

    optional desired number of buckets over the specified timerange

  • bucketDuration (String)

    optional interval (default no aggregation)

  • distinct (String)

    optional set to true to return only distinct, contiguous values

  • limit (Integer)

    optional limit the number of data points returned

  • order (String)

    optional Data point sort order, based on timestamp (ASC, DESC)

Returns:

  • (Array[Hash])

    datapoints

See Also:



332
333
334
335
336
337
# File 'lib/hawkular/metrics/metric_api.rb', line 332

def get_data(id, starts: nil, ends: nil, bucketDuration: nil, buckets: nil, distinct: nil, limit: nil,
  order: nil)
  params = { start: starts, end: ends, bucketDuration: bucketDuration, buckets: buckets,
             distinct: distinct, limit: limit, order: order }
  get_data_helper(id, params)
end