bin/instrument_server in instrumental_tools-0.5.3 vs bin/instrument_server in instrumental_tools-0.5.4
- old
+ new
@@ -348,10 +348,12 @@
def self.run(options)
agent = Instrumental::Agent.new(options[:api_key], :collector => [options[:collector], options[:port]].compact.join(':'))
puts "Collecting stats under the hostname: #{options[:hostname]}"
loop do
- sleep 10
+ t = Time.now.to_i
+ next_minute = (t - t % 60) + 60
+ sleep [next_minute - t, 0].max
inspector = SystemInspector.new
inspector.load_all
inspector.gauges.each do |stat, value|
agent.gauge("#{options[:hostname]}.#{stat}", value)
end