public class StatsCollection extends Object implements org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean, org.springframework.context.ApplicationContextAware
| Constructor and Description |
|---|
StatsCollection() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet()
Reads stats data from file on disk.
|
void |
destroy() |
long |
getLastValueForStat(String statName)
Gets the last value for stat.
|
int |
getMaxFiles()
Gets the max files.
|
List<org.jfree.data.xy.XYDataItem> |
getStats(String name)
Gets the stats.
|
Map<String,List<org.jfree.data.xy.XYDataItem>> |
getStatsByPrefix(String statNamePrefix)
Returns series if stat name starts with the prefix.
|
String |
getStoragePath()
Gets the storage path.
|
String |
getSwapFileName()
Gets the swap file name.
|
boolean |
isCollected(String statsName)
Checks if is collected.
|
void |
lockForUpdate()
Lock for update.
|
List<org.jfree.data.xy.XYDataItem> |
newStats(String name,
int maxElements)
New stats.
|
void |
releaseLock()
Release lock.
|
void |
resetStats(String name)
Reset stats.
|
void |
serialize()
Writes stats data to file on disk.
|
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
void |
setMaxFiles(int maxFiles)
Sets the max files.
|
void |
setStoragePath(String storagePath)
Sets the storage path.
|
void |
setSwapFileName(String swapFileName)
Sets the swap file name.
|
public String getSwapFileName()
@Value(value="stats.xml") public void setSwapFileName(String swapFileName)
swapFileName - the new swap file namepublic String getStoragePath()
public void setStoragePath(String storagePath)
storagePath - the new storage pathpublic boolean isCollected(String statsName)
statsName - the stats namepublic int getMaxFiles()
public void setMaxFiles(int maxFiles)
maxFiles - the new max filespublic List<org.jfree.data.xy.XYDataItem> newStats(String name, int maxElements)
name - the namemaxElements - the max elementspublic void resetStats(String name)
name - the namepublic List<org.jfree.data.xy.XYDataItem> getStats(String name)
name - the namepublic long getLastValueForStat(String statName)
statName - the stat namepublic Map<String,List<org.jfree.data.xy.XYDataItem>> getStatsByPrefix(String statNamePrefix)
statNamePrefix - they key under which the stats are storedpublic void serialize()
throws InterruptedException
InterruptedException - if a lock cannot be obtainedpublic void lockForUpdate()
throws InterruptedException
InterruptedException - the interrupted exceptionpublic void releaseLock()
public void afterPropertiesSet()
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanpublic void destroy()
throws Exception
destroy in interface org.springframework.beans.factory.DisposableBeanExceptionpublic void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
setApplicationContext in interface org.springframework.context.ApplicationContextAwareCopyright © 2009–2020 psi-probe. All rights reserved.