public class FileMonitoringTimerTask extends MonitoringTimerTask
FileMonitoringTimerTask
class allows to periodically watch JMX attributes
and store the corresponding values to a file in CSV format.Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_MONITORING_CONFIG_PATH
Default value for the pathname of a configuration file for a csv file monitoring
task in the server, value is
fileMonitoring.props . |
static long |
DEFAULT_MONITORING_CONFIG_PERIOD
Default value for the scanning period for the csv file monitoring task in the
server, value is
60000L (60 seconds). |
static String |
DEFAULT_MONITORING_RESULT_PATH
Default value for the pathname of the results file for the monitoring task
in the server, value is
monitoringStats.csv . |
static String |
MONITORING_CONFIG_PATH_PROPERTY
Name of property allowing to fix the pathname of a configuration file for a
csv file monitoring task in the server.
|
static String |
MONITORING_CONFIG_PERIOD_PROPERTY
Name of property allowing to fix the scanning period for the csv file monitoring
task in the server.
|
static String |
MONITORING_RESULT_PATH_PROPERTY
Name of property allowing to fix the pathname of the results file for the
csv file monitoring task in the server.
|
String |
path
Pathname of the result file.
|
(package private) StringBuffer |
strbuf |
(package private) Timer |
timer |
(package private) FileWriter |
writer |
attlist, logger, MBean_name, period
Constructor and Description |
---|
FileMonitoringTimerTask()
Instantiates the
FileMonitoringTimerTask component. |
FileMonitoringTimerTask(Timer timer,
long period,
Properties attlist,
String path)
Initializes the
FileMonitoringTimerTask component. |
Modifier and Type | Method and Description |
---|---|
protected void |
addRecord(String mbean,
String att,
Object value)
Records information about the specified attribute.
|
void |
close()
Close the result file, be careful you have to call this method only if the
monitoring task is stopped.
|
protected void |
finalizeRecords()
Finalize the record for the current time.
|
void |
init(Timer timer,
long period,
Properties attlist,
Properties taskProps)
Initializes the
FileMonitoringTimerTask component. |
protected void |
initializeRecords()
Initialize the record for the current collect time.
|
addMonitoredAttributes, cancelTask, delMonitoredAttributes, getMonitoredAttributes, getPeriod, run, start
cancel, scheduledExecutionTime
public static final String MONITORING_CONFIG_PERIOD_PROPERTY
This property can be fixed either from java
launching command,
or in a3servers.xml
configuration file.
FileMonitoringTimerTask
,
Constant Field Valuespublic static final long DEFAULT_MONITORING_CONFIG_PERIOD
60000L
(60 seconds).FileMonitoringTimerTask
,
Constant Field Valuespublic static final String MONITORING_CONFIG_PATH_PROPERTY
This property can be fixed either from java
launching command,
or in a3servers.xml
configuration file.
FileMonitoringTimerTask
,
Constant Field Valuespublic static final String DEFAULT_MONITORING_CONFIG_PATH
fileMonitoring.props
.
If the file does not exist the timer task is not launched.
FileMonitoringTimerTask
,
Constant Field Valuespublic static final String MONITORING_RESULT_PATH_PROPERTY
This property can be fixed either from java
launching command,
or in a3servers.xml
configuration file.
FileMonitoringTimerTask
,
Constant Field Valuespublic static final String DEFAULT_MONITORING_RESULT_PATH
monitoringStats.csv
.FileMonitoringTimerTask
,
Constant Field ValuesFileWriter writer
StringBuffer strbuf
Timer timer
public String path
public FileMonitoringTimerTask(Timer timer, long period, Properties attlist, String path)
FileMonitoringTimerTask
component.timer
- Timer to use to schedule the resulting task.period
- Period value of the resulting taskattlist
- List of JMX attributes to periodically watch.path
- Pathname of resulting CSV file.public FileMonitoringTimerTask()
FileMonitoringTimerTask
component.public void init(Timer timer, long period, Properties attlist, Properties taskProps)
FileMonitoringTimerTask
component.init
in class MonitoringTimerTask
timer
- The timer to use to schedule the resulting task.period
- Period value of the resulting taskattlist
- List of JMX attributes to periodically watch.taskProps
- The properties to initialize the task.protected void initializeRecords()
initializeRecords
in class MonitoringTimerTask
MonitoringTimerTask.initializeRecords()
protected void addRecord(String mbean, String att, Object value)
addRecord
in class MonitoringTimerTask
mbean
- The name of the related mbean.att
- The name of the related attribute.value
- The value of the related attribute.protected void finalizeRecords()
finalizeRecords
in class MonitoringTimerTask
MonitoringTimerTask.finalizeRecords()
public void close()
Copyright © 2021 ScalAgent D.T.. All rights reserved.