public final class PerfStatMgr extends Object
PerfStatMgr provides runtime support for the internal
management, trim interval settings, and queries on statistics, whether
system or application-defined.
The "real" manager is RemotePerfStatMgr RMI remote object
that lives in the hydra master VM. Instances of this class provide a
friendly wrapper around the remote object. For instance, if a
java.rmi.RemoteException is thrown while performing some operation, it
is wrapped in a HydraRuntimeException.
| Modifier and Type | Field and Description |
|---|---|
protected static int |
RETRY_LIMIT
Number of times to retry reading archives before giving up.
|
| Modifier and Type | Method and Description |
|---|---|
void |
endTrim()
Marks the ending point for the default trim spec to use to
trim associated statistics in performance reports.
|
void |
endTrim(String trimspecName)
Marks the ending point for the specified trim spec to use to
trim associated statistics in performance reports.
|
static PerfStatMgr |
getInstance()
Returns an instance of
PerfStatMgr. |
List |
readStatistics(PerformanceStatistics statInst,
String statName)
Reads the named statistic for the statistics instance from archive files.
|
List |
readStatistics(RuntimeStatSpec statspec)
Reads statistics from archive files based on the specification.
|
List |
readStatistics(RuntimeStatSpec statspec,
TrimSpec trimspec)
Reads statistics from archive files based on the specification and
trimspec.
|
List |
readStatistics(String specification)
Reads statistics from archive files based on the specification string.
|
List |
readStatistics(String specification,
boolean exactMatch)
Reads statistics from archive files based on the specification string.
|
List |
readStatistics(String specification,
TrimSpec trimspec)
Reads statistics from archive files based on the specification string and
trimspec.
|
protected void |
registerStatistics(PerformanceStatistics statInst)
For internal use only.
|
void |
reportExtendedTrimInterval(TrimInterval interval)
Reports the specified extended trim interval.
|
void |
reportExtendedTrimIntervals(Map intervals)
Reports the specified extended trim intervals.
|
void |
reportTrimInterval(TrimInterval interval)
Reports the specified trim interval.
|
void |
reportTrimIntervals(Map intervals)
Reports the specified trim intervals.
|
void |
startTrim()
Marks the starting point for the default trim spec to use to
trim associated statistics in performance reports.
|
void |
startTrim(String trimspecName)
Marks the starting point for the specified trim spec to use to
trim associated statistics in performance reports.
|
protected static int RETRY_LIMIT
public static PerfStatMgr getInstance()
PerfStatMgr.HydraRuntimeException - Something goes wrong while looking up remote objectpublic void startTrim()
public void startTrim(String trimspecName)
trimspecName - The name of the trim spec for which to record a start time.public void endTrim()
public void endTrim(String trimspecName)
trimspecName - The name of the trim spec for which to record an end time.public void reportTrimInterval(TrimInterval interval)
public void reportExtendedTrimInterval(TrimInterval interval)
public void reportTrimIntervals(Map intervals)
public void reportExtendedTrimIntervals(Map intervals)
protected void registerStatistics(PerformanceStatistics statInst)
Registers a new statistics instance with the hydra master so that master is aware of its existence.
statInst - The statistic instance to register.public List readStatistics(String specification, TrimSpec trimspec)
StatConfigException - if the specification string is malformed.public List readStatistics(String specification)
instanceId and optional
statSpecParams as indicated in the specification grammar
statspec_grammar.txt. Returns all
statistics that match the specification.
Example
// uses perffmwk.samples.SampleThreadStatistics
String spec = "* " // search all archives
+ "perffmwk.samples.SampleThreadStatistics "
+ "* " // match all instances
+ SampleThreadStatistics.OPS + " "
+ StatSpecTokens.FILTER_TYPE + "=" + StatSpecTokens.FILTER_NONE + " "
+ StatSpecTokens.COMBINE_TYPE + "=" + StatSpecTokens.COMBINE_ACROSS_FILES + " "
+ StatSpecTokens.OP_TYPES + "=" + StatSpecTokens.MAX;
List psvs = PerfStatMgr.getInstance().readStatistics( spec );
StatConfigException - if the specification string is malformed.public List readStatistics(String specification, boolean exactMatch)
instanceId and optional
statSpecParams as indicated in the specification grammar
statspec_grammar.txt. Returns all
statistics that match the specification.
Example
// uses perffmwk.samples.SampleThreadStatistics
String spec = "* " // search all archives
+ perffmwk.samples.SampleThreadStatistics "
+ "* " // match all instances
+ SampleThreadStatistics.OPS + " "
+ StatSpecTokens.FILTER_TYPE + "=" + StatSpecTokens.FILTER_NONE + " "
+ StatSpecTokens.COMBINE_TYPE + "=" + StatSpecTokens.COMBINE_ACROSS_FILES + " "
+ StatSpecTokens.OP_TYPES + "=" + StatSpecTokens.MAX;
List psvs = PerfStatMgr.getInstance().readStatistics( spec );
exactMatch - Determines if the stat type should be an exact match (to avoid
confusion between the product's CachePerfStats and the framework's
cacheperf.CachePerfStats.StatConfigException - if the specification string is malformed.public List readStatistics(PerformanceStatistics statInst, String statName)
Example
// uses perffmwk.samples.SampleThreadStatistics SampleThreadStatistics statInst = SampleThreadStatistics.getInstance(); List psvs = PerfStatMgr.getInstance().readStatistics( statInst, SampleThreadStatistics.OPS );
public List readStatistics(RuntimeStatSpec statspec)
public List readStatistics(RuntimeStatSpec statspec, TrimSpec trimspec)
Example
// uses perffmwk.samples.SampleThreadStatistics SampleThreadStatistics statInst = SampleThreadStatistics.getInstance(); StatisticDescriptor sd = statInst.getStatisticDescriptor( SampleThreadStatistics.OPS ); RuntimeStatSpec statSpec = new RuntimeStatSpec( statInst, sd ); // change default spec a bit statSpec.setFilter( StatSpecTokens.FILTER_NONE ); statSpec.setCombineType( StatSpecTokens.COMBINE_ACROSS_ARCHIVES ); statSpec.setStddev( false ); List psvs = PerfStatMgr.getInstance().readStatistics( statSpec );
Copyright © 2010-2015 Pivotal Software, Inc. All rights reserved.