public abstract class AbstractStatsCollectorBean extends Object
| Constructor and Description |
|---|
AbstractStatsCollectorBean() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
buildAbsoluteStats(String name,
long value)
Builds the absolute stats.
|
protected void |
buildAbsoluteStats(String name,
long value,
long time)
Builds the absolute stats.
|
protected long |
buildDeltaStats(String name,
long value)
Builds the delta stats.
|
protected long |
buildDeltaStats(String name,
long value,
long time)
Builds the delta stats.
|
protected void |
buildTimePercentageStats(String name,
long value,
long time)
If there is a value indicating the accumulated amount of time spent on something it is possible
to build a series of values representing the percentage of time spent on doing something.
|
abstract void |
collect()
Collect.
|
List<StatsCollectionListener> |
getListeners()
Gets the listeners.
|
int |
getMaxSeries()
Gets the max series.
|
StatsCollection |
getStatsCollection()
Gets the stats collection.
|
protected void |
resetStats(String name)
Reset stats.
|
void |
setListeners(List<StatsCollectionListener> listeners)
Sets the listeners.
|
void |
setMaxSeries(int maxSeries)
Sets the max series.
|
void |
setStatsCollection(StatsCollection statsCollection)
Sets the stats collection.
|
public StatsCollection getStatsCollection()
public void setStatsCollection(StatsCollection statsCollection)
statsCollection - the new stats collectionpublic int getMaxSeries()
public void setMaxSeries(int maxSeries)
maxSeries - the new max seriespublic List<StatsCollectionListener> getListeners()
public void setListeners(List<StatsCollectionListener> listeners)
listeners - the new listenersprotected long buildDeltaStats(String name, long value) throws InterruptedException
name - the namevalue - the valueInterruptedException - the interrupted exceptionprotected long buildDeltaStats(String name, long value, long time) throws InterruptedException
name - the namevalue - the valuetime - the timeInterruptedException - the interrupted exceptionprotected void buildAbsoluteStats(String name, long value) throws InterruptedException
name - the namevalue - the valueInterruptedException - the interrupted exceptionprotected void buildAbsoluteStats(String name, long value, long time) throws InterruptedException
name - the namevalue - the valuetime - the timeInterruptedException - the interrupted exceptionprotected void buildTimePercentageStats(String name, long value, long time) throws InterruptedException
at point T1 the system has spent A milliseconds performing tasks at point T2 the system has spent B milliseconds performing tasks
so between in a timeframe T2-T1 the system spent B-A milliseconds being busy. Thus (B - A)/(T2 - T1) * 100 is the percentage of all time the system spent being busy.
name - the name of the value, which allows the collector to be used for multiple valuesvalue - time spent on the task in milliseconds (A or B in the example above)time - system time in milliseconds (T1 or T2 in the example above)InterruptedException - if a lock could not be obtainedprotected void resetStats(String name)
name - the nameCopyright © 2009–2020 psi-probe. All rights reserved.