com.bigdata.counters.win
Class TypeperfCollector

java.lang.Object
  extended by com.bigdata.counters.AbstractProcessCollector
      extended by com.bigdata.counters.win.TypeperfCollector
All Implemented Interfaces:
ICounterSetAccess, IStatisticsCollector

public class TypeperfCollector
extends AbstractProcessCollector

Collects per-host performance counters on a Windows platform using typeperf and aligns them with those declared by IRequiredHostCounters.

Note: The names of counters under Windows are NOT case-sensitive.

Version:
$Id: TypeperfCollector.java 4289 2011-03-10 21:22:30Z thompsonbry $
Author:
Bryan Thompson
TODO:
declarative configuration for properties to be collected and their alignment with our counter hierarchy.

Field Summary
protected static boolean DEBUG
          True iff the log level is DEBUG or less.
protected  List<com.bigdata.counters.win.TypeperfCollector.InstrumentForWPC> decls
          List of performance counters that we will be collecting.
protected static boolean INFO
          True iff the log level is INFO or less.
protected static org.apache.log4j.Logger log
           
 
Fields inherited from class com.bigdata.counters.AbstractProcessCollector
activeProcess
 
Constructor Summary
TypeperfCollector(int interval)
           
 
Method Summary
 List<String> getCommand()
          Generate command to write performance counters on the console.
 CounterSet getCounters()
          Declares the performance counters to be collected from the Windows platform.
 AbstractProcessReader getProcessReader()
           
 
Methods inherited from class com.bigdata.counters.AbstractProcessCollector
getInterval, setEnvironment, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static final org.apache.log4j.Logger log

INFO

protected static final boolean INFO
True iff the log level is INFO or less.


DEBUG

protected static final boolean DEBUG
True iff the log level is DEBUG or less.


decls

protected List<com.bigdata.counters.win.TypeperfCollector.InstrumentForWPC> decls
List of performance counters that we will be collecting.

See Also:
#getCounters(), which sets up this list.
Constructor Detail

TypeperfCollector

public TypeperfCollector(int interval)
Parameters:
interval -
Method Detail

getCommand

public List<String> getCommand()
Generate command to write performance counters on the console.

The sample interval format is -si [hh:[mm:]]ss.

Note: typeperf supports csv, tab, and bin output formats. However specifying tsv (tab delimited) causes it to always write on a file so I am using csv (comma delimited, which is the default in any case).

Specified by:
getCommand in class AbstractProcessCollector
Throws:
IOException
TODO:
While this approach seems fine to obtain the system wide counters under Windows it runs into problems when you attempt to obtain the process specific counters. The difficulty is that you can not use the PID when you request counters for a process and it appears that the counters for all processes having the same _name_ are aggregated, or at least can not be distinguished, using [typeperf].

getProcessReader

public AbstractProcessReader getProcessReader()
Specified by:
getProcessReader in class AbstractProcessCollector

getCounters

public CounterSet getCounters()
Declares the performance counters to be collected from the Windows platform.



Copyright © 2006-2012 SYSTAP, LLC. All Rights Reserved.