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
31: def filtered
32: Log.debug("Incrementing filtered stat")
33: @filtered += 1
34: end
Records a message that passed the filters
# File lib/mcollective/runnerstats.rb, line 25
25: def passed
26: Log.debug("Incrementing passed stat")
27: @passed += 1
28: end
Records receipt of a message
# File lib/mcollective/runnerstats.rb, line 48
48: def received
49: Log.debug("Incrementing total stat")
50: @total += 1
51: end
Records sending a message
# File lib/mcollective/runnerstats.rb, line 54
54: def sent
55: @mutex.synchronize do
56: Log.debug("Incrementing replies stat")
57: @replies += 1
58: end
59: end
Returns a hash with all stats
# File lib/mcollective/runnerstats.rb, line 62
62: def to_hash
63: stats = {:validated => @validated,
64: :unvalidated => @unvalidated,
65: :passed => @passed,
66: :filtered => @filtered,
67: :starttime => @starttime,
68: :total => @total,
69: :ttlexpired => @ttlexpired,
70: :replies => @replies}
71:
72: reply = {:stats => stats,
73: :threads => [],
74: :pid => Process.pid,
75: :times => {} }
76:
77: ::Process.times.each_pair{|k,v|
78: k = k.to_sym
79: reply[:times][k] = v
80: }
81:
82: Thread.list.each do |t|
83: reply[:threads] << "#{t.inspect}"
84: end
85:
86: reply[:agents] = Agents.agentlist
87: reply
88: end
Records a message that failed TTL checks
# File lib/mcollective/runnerstats.rb, line 19
19: def ttlexpired
20: Log.debug("Incrementing ttl expired stat")
21: @ttlexpired += 1
22: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.