// --- BEGIN COPYRIGHT BLOCK --- // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; version 2 of the License. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with this program; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. // // (C) 2007 Red Hat, Inc. // All rights reserved. // --- END COPYRIGHT BLOCK --- package com.netscape.cmscore.util; import java.util.Date; import java.util.Hashtable; import java.util.Vector; import com.netscape.certsrv.apps.CMS; import com.netscape.certsrv.base.EBaseException; import com.netscape.certsrv.base.IConfigStore; import com.netscape.certsrv.base.ISubsystem; import com.netscape.certsrv.util.IStatsSubsystem; import com.netscape.certsrv.util.StatsEvent; /** * A class represents a internal subsystem. This subsystem * can be loaded into cert server kernel to perform * statistics collection. *
*
* @author thomask
* @version $Revision$, $Date$
*/
public class StatsSubsystem implements IStatsSubsystem {
private String mId = null;
private StatsEvent mAllTrans = new StatsEvent(null);
private Date mStartTime = new Date();
private Hashtable
* Note that individual subsystem should be initialized in a separated thread if it has dependency on the
* initialization of other subsystems.
*
*
* @param owner owner of this subsystem
* @param config configuration store
*/
public synchronized void init(ISubsystem owner, IConfigStore config)
throws EBaseException {
}
public Date getStartTime() {
return mStartTime;
}
public void startTiming(String id) {
startTiming(id, false /* not the main */);
}
public void startTiming(String id, boolean mainAction) {
Thread t = Thread.currentThread();
Vector
*
* @return configuration store of this subsystem
*/
public IConfigStore getConfigStore() {
return null;
}
}
class StatsMilestone {
private String mId = null;
private long mStartTime = 0;
private StatsEvent mST = null;
public StatsMilestone(String id, long startTime, StatsEvent st) {
mId = id;
mStartTime = startTime;
mST = st;
}
public String getId() {
return mId;
}
public long getStartTime() {
return mStartTime;
}
public StatsEvent getStatsEvent() {
return mST;
}
}