Class to store stats about the mcollectived, it should live in the PluginManager so that agents etc can get hold of it and return the stats to callers
Records a message that didnt pass the filters
# File lib/mcollective/runnerstats.rb, line 31 def filtered Log.debug("Incrementing filtered stat") @filtered += 1 end
Records a message that passed the filters
# File lib/mcollective/runnerstats.rb, line 25 def passed Log.debug("Incrementing passed stat") @passed += 1 end
Records receipt of a message
# File lib/mcollective/runnerstats.rb, line 48 def received Log.debug("Incrementing total stat") @total += 1 end
Records sending a message
# File lib/mcollective/runnerstats.rb, line 54 def sent @mutex.synchronize do Log.debug("Incrementing replies stat") @replies += 1 end end
Returns a hash with all stats
# File lib/mcollective/runnerstats.rb, line 62 def to_hash stats = {:validated => @validated, :unvalidated => @unvalidated, :passed => @passed, :filtered => @filtered, :starttime => @starttime, :total => @total, :ttlexpired => @ttlexpired, :replies => @replies} reply = {:stats => stats, :threads => [], :pid => Process.pid, :times => {} } ::Process.times.each_pair{|k,v| k = k.to_sym reply[:times][k] = v } Thread.list.each do |t| reply[:threads] << "#{t.inspect}" end reply[:agents] = Agents.agentlist reply end
Records a message that failed TTL checks
# File lib/mcollective/runnerstats.rb, line 19 def ttlexpired Log.debug("Incrementing ttl expired stat") @ttlexpired += 1 end
Generated with the Darkfish Rdoc Generator 2.