org.mmbase.applications.crontab
Class MMBaseStatsJob
java.lang.Object
org.mmbase.applications.crontab.AbstractCronJob
org.mmbase.applications.crontab.MMBaseStatsJob
- All Implemented Interfaces:
- CronJob, Runnable
- public class MMBaseStatsJob
- extends AbstractCronJob
An example cron-job.
A Job to log MMBase statistics to a logger. (By means of logj4 you can configure the time stamp and logfile location).
The configuration string is one of the following
- MEMORY: Logs free and total memory
- CACHE.<cache-name>: Logs hits and total request of cache with given name
In log4j.xml you may add something like this:
<appender name="stats" class="org.apache.log4j.FileAppender" >
<param name="File" value="/tmp/mmbase.stats" />
<param name="Encoding" value="UTF-8" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d{YYYY-MM-dd HH:mm:ss} %c{1} %m%n" />
</layout>
</appender>
and:
<logger name="org.mmbase.STATS" additivity="false">
<level class="&mmlevel;" value ="service" />
<appender-ref ref="stats" />
</logger>
- Version:
- $Id: MMBaseStatsJob.java,v 1.4 2006/06/23 18:11:56 michiel Exp $
- Author:
- Michiel Meeuwissen
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MMBaseStatsJob
public MMBaseStatsJob()
init
protected void init()
- Description copied from class:
AbstractCronJob
- You can init by overriding this (no need to call super.init)
This is called by
AbstractCronJob.init(CronEntry)
- Overrides:
init in class AbstractCronJob
run
public final void run()
- Description copied from class:
AbstractCronJob
- Implement this.
- Specified by:
run in interface CronJob- Specified by:
run in class AbstractCronJob
MMBase build 1.8.1.20060716