Class: Bipbip::Plugin::Memcached
- Inherits:
-
Bipbip::Plugin
- Object
- Bipbip::Plugin
- Bipbip::Plugin::Memcached
- Defined in:
- lib/bipbip/plugin/memcached.rb
Instance Method Summary collapse
Methods inherited from Bipbip::Plugin
#initialize, #interrupt, #interrupted?, #metric_identifier, #metrics_names, #name, #run
Methods included from InterruptibleSleep
#interrupt_sleep, #interruptible_sleep
Constructor Details
This class inherits a constructor from Bipbip::Plugin
Instance Method Details
#metrics_schema ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/bipbip/plugin/memcached.rb', line 9 def metrics_schema [ {:name => 'cmd_get', :type => 'ce_counter'}, {:name => 'cmd_set', :type => 'ce_counter'}, {:name => 'get_misses', :type => 'ce_counter'}, {:name => 'limit_maxbytes', :type => 'ce_gauge', :unit => 'b'}, {:name => 'bytes', :type => 'ce_gauge', :unit => 'b'}, ] end |
#monitor(server) ⇒ Object
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/bipbip/plugin/memcached.rb', line 19 def monitor(server) cache = MemcachedClient.new(server['hostname'] + ':' + server['port'].to_s) stats = cache.stats data = {} metrics_names.each do |key| data[key] = stats[key.to_sym].shift.to_i end data end |