Class: Drone::Interfaces::Console
- Defined in:
- lib/drone/interfaces/console.rb
Overview
This interface is meant for debug mainly, it will simply output all the available metrics at a regular interval on the console.
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from Drone::Interfaces::Base
Instance Method Details
#output ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/drone/interfaces/console.rb', line 17 def output() puts "" puts "[#{Time.now.strftime('%M:%S')}] Drone report:" Drone::each_metric do |m| case m when Metrics::Gauge puts "[Gauge] #{m.name} : #{m.value}" when Metrics::Counter puts "[Counter] #{m.name} : #{m.value}" when Metrics::Timer puts "[Timer] #{m.name}" print_histogram(m) when Metrics::Meter puts "[Meter] #{m.name}" print_meter(m) when Metrics::Histogram puts "[Histogram] #{m.name}" print_histogram(m) else puts "Unknown metric: #{m}" end end end |