2 # Class to store stats about the mcollectived, it should live in the PluginManager
3 # so that agents etc can get hold of it and return the stats to callers
6 @starttime = Time.now.to_i
18 # Records a message that failed TTL checks
20 Log.debug("Incrementing ttl expired stat")
24 # Records a message that passed the filters
26 Log.debug("Incrementing passed stat")
30 # Records a message that didnt pass the filters
32 Log.debug("Incrementing filtered stat")
36 # Records a message that validated ok
38 Log.debug("Incrementing validated stat")
43 Log.debug("Incrementing unvalidated stat")
47 # Records receipt of a message
49 Log.debug("Incrementing total stat")
53 # Records sending a message
56 Log.debug("Incrementing replies stat")
61 # Returns a hash with all stats
63 stats = {:validated => @validated,
64 :unvalidated => @unvalidated,
66 :filtered => @filtered,
67 :starttime => @starttime,
69 :ttlexpired => @ttlexpired,
72 reply = {:stats => stats,
77 ::Process.times.each_pair{|k,v|
82 Thread.list.each do |t|
83 reply[:threads] << "#{t.inspect}"
86 reply[:agents] = Agents.agentlist