Class: Lbrt::Metric
- Inherits:
-
Object
- Object
- Lbrt::Metric
- Includes:
- Logger::Helper
- Defined in:
- lib/lbrt/metric.rb
Instance Method Summary collapse
-
#initialize(client, options = {}) ⇒ Metric
constructor
A new instance of Metric.
- #list ⇒ Object
- #peco ⇒ Object
Methods included from Logger::Helper
Constructor Details
#initialize(client, options = {}) ⇒ Metric
Returns a new instance of Metric.
4 5 6 7 |
# File 'lib/lbrt/metric.rb', line 4 def initialize(client, = {}) @client = client = end |
Instance Method Details
#list ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/lbrt/metric.rb', line 9 def list json = {} metric_names = build_metric_names metric_names.each do |name| json[name] = { url: metric_url(name), } end puts JSON.pretty_generate(json) end |
#peco ⇒ Object
22 23 24 25 26 27 28 29 30 |
# File 'lib/lbrt/metric.rb', line 22 def peco metric_names = build_metric_names result = PecoSelector.select_from(metric_names) result.each do |name| url = metric_url(name) Lbrt::Utils.open(url) end end |