lib/onering/plugins/reporter.rb in onering-client-0.0.97 vs lib/onering/plugins/reporter.rb in onering-client-0.0.98
- old
+ new
@@ -123,17 +123,21 @@
instance_eval(&block)
end
end
def property(name, value=nil)
- Onering::Logger.debug3("-> Set property #{name.to_s}", "Onering::Reporter")
- @_report[:properties].set(name.to_s, value) unless value.nil?
+ unless value.nil?
+ Onering::Logger.debug3("-> Set property #{name.to_s} (was: #{@_report[:properties].get(name.to_s,'null')})", "Onering::Reporter")
+ @_report[:properties].set(name.to_s, value)
+ end
end
def stat(name, value=nil)
- @_report[:properties][:metrics] ||= {}
- Onering::Logger.debug3("-> Set metric #{name.to_s}", "Onering::Reporter")
- @_report[:properties][:metrics].set(name.to_s, value) unless value.nil?
+ unless value.nil?
+ @_report[:properties][:metrics] ||= {}
+ Onering::Logger.debug3("-> Set metric #{name.to_s}", "Onering::Reporter")
+ @_report[:properties][:metrics].set(name.to_s, value)
+ end
end
def report()
@id = (@options[:id] || Onering::Util.fact('hardwareid', nil))