class WavefrontDisplay::Metric
Format human-readable output for metrics.
Public Instance Methods
bail_out()
click to toggle source
# File lib/wavefront-cli/display/metric.rb, line 34 def bail_out puts "Did not find metric '#{options[:'<metric>']}'." exit end
do_describe()
click to toggle source
# File lib/wavefront-cli/display/metric.rb, line 10 def do_describe bail_out if no_data? @data = data['hosts'].map do |h, _aggr| { host: h[:host], last_update: human_time(h[:last_update]) } end @data.sort_by { |h| h[:last_update] }.reverse multicolumn(:host, :last_update) end
do_list_under()
click to toggle source
# File lib/wavefront-cli/display/metric.rb, line 22 def do_list_under bail_out if data.empty? puts data.sort end
Also aliased as: do_list_all
no_data?()
click to toggle source
# File lib/wavefront-cli/display/metric.rb, line 30 def no_data? data.empty? || data.hosts.empty? end