Class: Sensu::Plugin::Metric::CLI::JSON
- Defined in:
- lib/sensu-plugin/metric/cli.rb
Instance Attribute Summary
Attributes inherited from CLI
Instance Method Summary collapse
Methods inherited from CLI
Instance Method Details
#output(obj = nil) ⇒ Object
10 11 12 13 14 15 |
# File 'lib/sensu-plugin/metric/cli.rb', line 10 def output(obj=nil) unless obj.nil? || obj.is_a?(String) || obj.is_a?(Exception) obj['timestamp'] ||= Time.now.to_i puts ::JSON.generate(obj) end end |