Class: McDump::Memcached::Server

Inherits:
Object
  • Object
show all
Defined in:
lib/mc_dump/memcached/server.rb

Instance Method Summary collapse

Constructor Details

#initialize(connection_args) ⇒ Server

Returns a new instance of Server.


6
7
8
# File 'lib/mc_dump/memcached/server.rb', line 6

def initialize(connection_args)
  @connection_args = connection_args
end

Instance Method Details

#itemsObject


10
11
12
13
14
15
# File 'lib/mc_dump/memcached/server.rb', line 10

def items
  McDump::Telnet::Session.open(@connection_args) do |session|
    item_stats = McDump::Memcached::Stat.parse(session.stats)
    item_stats.map { |stat| stat.items(session) }.flatten
  end
end