com.sun.faban.harness.tools
Class MemcacheStats

java.lang.Object
  extended by com.sun.faban.harness.tools.MemcacheStats

Deprecated.

@Deprecated
public class MemcacheStats
extends Object

MemcacheStats.java This program implements a tool to collect memcache stats from a list of servers. The stats are collected and displayed at the specified interval. Most of the stats are on a per. second basis allowing easy tabulation and comparison with other tools.

Author:
Shanti Subramanyam based on work by Kim LiChong

Constructor Summary
MemcacheStats(String[] servers, int interval)
          Deprecated. This constructor creates a memcache client with a pool of servers.
 
Method Summary
 TextTable getStats()
          Deprecated. This method is used for dynamic memcache stats gathering.
static void main(String[] args)
          Deprecated. This main method is used to gather dynamic statistics on memcache server instances.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MemcacheStats

public MemcacheStats(String[] servers,
                     int interval)
              throws IOException
Deprecated. 
This constructor creates a memcache client with a pool of servers.

Parameters:
servers - - name of servers running memcached
interval - - interval in secs for stats collection
Throws:
IOException - Cannot connect to memcached
Method Detail

getStats

public TextTable getStats()
Deprecated. 
This method is used for dynamic memcache stats gathering. We only gather and print out the following stats in a single row: cur_itms bytes cur_conns sets gets get_hits get_misses evicts bytes_r, bytes_w Since memcached returns cumulative stats, we do the subtraction to get the stats for this interval and then figure out stats/sec

Returns:
TextTable - a single row of stats

main

public static void main(String[] args)
                 throws IOException
Deprecated. 
This main method is used to gather dynamic statistics on memcache server instances. The primary arguments are the names of the memcached servers It accepts the following optional argument: -i interval the snapshot period to collect the stats, in seconds (default 10) Usage: java com.sun.faban.harnes.tools.MemcacheStats host[:port]... [-i interval] It creates an instance of MemcacheStats and sets up a timer task at the specified interval to gather the stats.

Parameters:
args - Command line argument
Throws:
IOException - Cannot connect to memcached