Method: KJess::Client#stats!
- Defined in:
- lib/kjess/client.rb
#stats! ⇒ Object
Internal: Return the hash of stats
Using a combination of the STATS and DUMP_STATS commands this generates a good overview of all the most used stats for a Kestrel server.
Returns a Hash
257 258 259 260 261 262 263 264 265 266 267 268 |
# File 'lib/kjess/client.rb', line 257 def stats! stats = send_recv( KJess::Request::Stats.new ) raise KJess::ProtocolError, "Problem receiving stats: #{stats.inspect}" unless KJess::Response::Stats === stats h = stats.data dump_stats = send_recv( KJess::Request::DumpStats.new ) h['queues'] = Hash.new if KJess::Response::DumpedStats === dump_stats then h['queues'].merge!( dump_stats.data ) end return h end |