Class: MemcacheStat

Inherits:
Object
  • Object
show all
Defined in:
lib/memcache_stat.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hostname = "localhost", port = "11211") ⇒ MemcacheStat

Returns a new instance of MemcacheStat.



31
32
33
34
35
# File 'lib/memcache_stat.rb', line 31

def initialize(hostname="localhost", port="11211")
  @hostname, @port = hostname, port
  refresh_raw_stats!
  parse_stats(@raw)
end

Instance Attribute Details

#bytesObject

Hostname to connect with



5
6
7
# File 'lib/memcache_stat.rb', line 5

def bytes
  @bytes
end

#bytes_readObject

Hostname to connect with



5
6
7
# File 'lib/memcache_stat.rb', line 5

def bytes_read
  @bytes_read
end

#bytes_writtenObject

Hostname to connect with



5
6
7
# File 'lib/memcache_stat.rb', line 5

def bytes_written
  @bytes_written
end

#cmd_getObject

Hostname to connect with



5
6
7
# File 'lib/memcache_stat.rb', line 5

def cmd_get
  @cmd_get
end

#cmd_setObject

Hostname to connect with



5
6
7
# File 'lib/memcache_stat.rb', line 5

def cmd_set
  @cmd_set
end

#connection_structuresObject

Hostname to connect with



5
6
7
# File 'lib/memcache_stat.rb', line 5

def connection_structures
  @connection_structures
end

#curr_connectionsObject

Hostname to connect with



5
6
7
# File 'lib/memcache_stat.rb', line 5

def curr_connections
  @curr_connections
end

#curr_itemsObject

Hostname to connect with



5
6
7
# File 'lib/memcache_stat.rb', line 5

def curr_items
  @curr_items
end

#evictionsObject

Hostname to connect with



5
6
7
# File 'lib/memcache_stat.rb', line 5

def evictions
  @evictions
end

#get_hitsObject

Hostname to connect with



5
6
7
# File 'lib/memcache_stat.rb', line 5

def get_hits
  @get_hits
end

#get_missesObject

Hostname to connect with



5
6
7
# File 'lib/memcache_stat.rb', line 5

def get_misses
  @get_misses
end

#hostnameObject

Hostname to connect with



5
6
7
# File 'lib/memcache_stat.rb', line 5

def hostname
  @hostname
end

#limit_maxbytesObject

Hostname to connect with



5
6
7
# File 'lib/memcache_stat.rb', line 5

def limit_maxbytes
  @limit_maxbytes
end

#pidObject

Hostname to connect with



5
6
7
# File 'lib/memcache_stat.rb', line 5

def pid
  @pid
end

#pointer_sizeObject

Hostname to connect with



5
6
7
# File 'lib/memcache_stat.rb', line 5

def pointer_size
  @pointer_size
end

#portObject

Hostname to connect with



5
6
7
# File 'lib/memcache_stat.rb', line 5

def port
  @port
end

#rawObject

Hostname to connect with



5
6
7
# File 'lib/memcache_stat.rb', line 5

def raw
  @raw
end

#rusage_systemObject

Hostname to connect with



5
6
7
# File 'lib/memcache_stat.rb', line 5

def rusage_system
  @rusage_system
end

#rusage_userObject

Hostname to connect with



5
6
7
# File 'lib/memcache_stat.rb', line 5

def rusage_user
  @rusage_user
end

#threadsObject

Hostname to connect with



5
6
7
# File 'lib/memcache_stat.rb', line 5

def threads
  @threads
end

#timeObject

Hostname to connect with



5
6
7
# File 'lib/memcache_stat.rb', line 5

def time
  @time
end

#total_connectionsObject

Hostname to connect with



5
6
7
# File 'lib/memcache_stat.rb', line 5

def total_connections
  @total_connections
end

#total_itemsObject

Hostname to connect with



5
6
7
# File 'lib/memcache_stat.rb', line 5

def total_items
  @total_items
end

#uptimeObject

Hostname to connect with



5
6
7
# File 'lib/memcache_stat.rb', line 5

def uptime
  @uptime
end

#versionObject

Hostname to connect with



5
6
7
# File 'lib/memcache_stat.rb', line 5

def version
  @version
end

Instance Method Details

#refresh!Object



37
38
39
40
41
# File 'lib/memcache_stat.rb', line 37

def refresh!
  refresh_raw_stats!
  parse_stats(@raw)
  true
end