Class: Hawkular::Metrics::Client::Strings

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

Overview

Class that interacts with “string” 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) ⇒ Strings

Returns a new instance of Strings

Parameters:



295
296
297
# File 'lib/hawkular/metrics/metric_api.rb', line 295

def initialize(client)
  super(client, 'string', 'strings')
end

Instance Method Details

#get_data(id, starts: nil, ends: 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)

  • 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:



308
309
310
311
# File 'lib/hawkular/metrics/metric_api.rb', line 308

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