final ClusterEventBus clusterEventBus = getClusterEventBus();
if (clusterEventBus==null) {
result.append("0\n0\n0\n");
} else {
SimpleProbe probe = clusterEventBus.getMrtgProbeJMSDeliveryTime();
if (command.equals("jmsDeliveryAvg")) {
result.append(roundedValueOf(probe.getAvg()));
} else if (command.equals("jmsDeliveryMax")) {
result.append(roundedValueOf(probe.getMax()));
} else if (command.equals("jmsDeliveryCnt")) {
result.append(roundedValueOf(probe.getNum()));
} else if (command.equals("jmsDeliveryReset")) {
probe.reset();
result.append("0");
}
result.append("\n0\n0\n");
}
result.append(instanceId);
} else if (command.startsWith("jmsProcessing")) {
final ClusterEventBus clusterEventBus = getClusterEventBus();
if (clusterEventBus==null) {
result.append("0\n0\n0\n");
} else {
SimpleProbe probe = clusterEventBus.getMrtgProbeJMSProcessingTime();
if (command.equals("jmsProcessingAvg")) {
result.append(roundedValueOf(probe.getAvg()));
} else if (command.equals("jmsProcessingMax")) {
result.append(roundedValueOf(probe.getMax()));
} else if (command.equals("jmsProcessingCnt")) {
result.append(roundedValueOf(probe.getNum()));
} else if (command.equals("jmsProcessingReset")) {
probe.reset();
result.append("0");
}
result.append("\n0\n0\n");
}
result.append(instanceId);
} else if (command.startsWith("jmsWaiting")) {
final ClusterEventBus clusterEventBus = getClusterEventBus();
if (clusterEventBus==null) {
result.append("0\n0\n0\n");
} else {
SimpleProbe probe = clusterEventBus.getMrtgProbeJMSLoad();
if (command.equals("jmsWaitingAvg")) {
result.append(roundedValueOf(probe.getAvg()));
} else if (command.equals("jmsWaitingMax")) {
result.append(roundedValueOf(probe.getMax()));
} else if (command.equals("jmsWaitingCnt")) {
result.append(roundedValueOf(probe.getNum()));
} else if (command.equals("jmsWaitingReset")) {
probe.reset();
result.append("0");
}
result.append("\n0\n0\n");
}
result.append(instanceId);
} else if (command.startsWith("jmsQueued")) {
final ClusterEventBus clusterEventBus = getClusterEventBus();
if (clusterEventBus==null) {
result.append("0\n0\n0\n");
} else {
SimpleProbe probe = clusterEventBus.getMrtgProbeJMSEnqueueTime();
if (command.equals("jmsQueuedAvg")) {
result.append(roundedValueOf(probe.getAvg()));
} else if (command.equals("jmsQueuedMax")) {
result.append(roundedValueOf(probe.getMax()));
} else if (command.equals("jmsQueuedCnt")) {
result.append(roundedValueOf(probe.getNum()));
} else if (command.equals("jmsQueuedReset")) {
probe.reset();
result.append("0");
}
result.append("\n0\n0\n");
}
result.append(instanceId);
} else if (command.equals("SecurityGroupMembershipImpl")) { // SecurityGroupMembershipImpl
org.olat.core.commons.persistence.SimpleProbe probe = DBQueryImpl.listTableStatsMap_.get("org.olat.basesecurity.SecurityGroupMembershipImpl");
if (probe==null) {
result.append("0\n0\n0\n");
} else {
result.append(roundedValueOf(probe.getSum()));
probe.reset();
result.append("\n0\n0\n");
}
result.append(instanceId);
} else if (command.equals("BGAreaImpl")) { // BGAreaImpl
org.olat.core.commons.persistence.SimpleProbe probe = DBQueryImpl.listTableStatsMap_.get("org.olat.group.area.BGAreaImpl");
if (probe==null) {
result.append("0\n0\n0\n");
} else {
result.append(roundedValueOf(probe.getSum()));
probe.reset();
result.append("\n0\n0\n");
}
result.append(instanceId);
} else if (command.equals("BusinessGroupImpl")) { // BusinessGroupImpl
org.olat.core.commons.persistence.SimpleProbe probe = DBQueryImpl.listTableStatsMap_.get("org.olat.group.BusinessGroupImpl");
if (probe==null) {
result.append("0\n0\n0\n");
} else {
result.append(roundedValueOf(probe.getSum()));
probe.reset();
result.append("\n0\n0\n");
}
result.append(instanceId);
} else if (command.equals("OLATResourceImpl")) { // OLATResourceImpl
org.olat.core.commons.persistence.SimpleProbe probe = DBQueryImpl.listTableStatsMap_.get("org.olat.resource.OLATResourceImpl");
if (probe==null) {
result.append("0\n0\n0\n");
} else {
result.append(roundedValueOf(probe.getSum()));
probe.reset();
result.append("\n0\n0\n");
}
result.append(instanceId);
} else if (command.equals("TheRest")) { // PolicyImpl
org.olat.core.commons.persistence.SimpleProbe probe = DBQueryImpl.listTableStatsMap_.get("THEREST");
if (probe==null) {
result.append("0\n0\n0\n");
} else {
result.append(roundedValueOf(probe.getSum()));
probe.reset();
result.append("\n0\n0\n");
}
result.append(instanceId);
} else if (command.equals("PolicyImpl")) { // PolicyImpl
org.olat.core.commons.persistence.SimpleProbe probe = DBQueryImpl.listTableStatsMap_.get("THEREST");
if (probe==null) {
result.append("0\n0\n0\n");
} else {
result.append(roundedValueOf(probe.getSum()));
probe.reset();
result.append("\n0\n0\n");
}
result.append(instanceId);
// dump details about all the non registered ones
Set<Entry<String, org.olat.core.commons.persistence.SimpleProbe>> entries = DBQueryImpl.listTableStatsMap_.entrySet();
Set<Entry<String, org.olat.core.commons.persistence.SimpleProbe>> nonRegisteredEntries = new HashSet<Entry<String,org.olat.core.commons.persistence.SimpleProbe>>();
long sum = 0;
for (Iterator<Entry<String, org.olat.core.commons.persistence.SimpleProbe>> it = entries.iterator(); it.hasNext();) {
Entry<String, org.olat.core.commons.persistence.SimpleProbe> entry = it.next();
if (!DBQueryImpl.registeredTables_.contains(entry.getKey())) {
nonRegisteredEntries.add(entry);
sum+=entry.getValue().getSum();
}
}
List<Entry<String, org.olat.core.commons.persistence.SimpleProbe>> list = new LinkedList<Entry<String, org.olat.core.commons.persistence.SimpleProbe>>(nonRegisteredEntries);
Collections.sort(
list, new Comparator<Entry<String, org.olat.core.commons.persistence.SimpleProbe>>() {
public int compare(
Entry<String, org.olat.core.commons.persistence.SimpleProbe> o1,
Entry<String, org.olat.core.commons.persistence.SimpleProbe> o2) {
if (o1.getValue().getSum()>o2.getValue().getSum()) {
return 1;
} else if (o1.getValue().getSum()==o2.getValue().getSum()) {
return 0;
} else {
return -1;
}
}
});
for (Iterator<Entry<String, org.olat.core.commons.persistence.SimpleProbe>> it = list.iterator(); it.hasNext();) {
Entry<String, org.olat.core.commons.persistence.SimpleProbe> entry = it.next();
Tracing.logInfo("MRTGStats: table '"+entry.getKey()+"' uses up "+entry.getValue().getSum()+"ms of a total of "+sum+"ms, which is "+Math.round(1000.0*entry.getValue().getSum()/sum)/10+"%", getClass());
entry.getValue().reset();
}
} else if (command.equals("LifeCycleEntry")) { // LifeCycleEntry
org.olat.core.commons.persistence.SimpleProbe probe = DBQueryImpl.listTableStatsMap_.get("org.olat.commons.lifecycle.LifeCycleEntry");
if (probe==null) {
result.append("0\n0\n0\n");
} else {
result.append(roundedValueOf(probe.getSum()));
probe.reset();
result.append("\n0\n0\n");
}
result.append(instanceId);
} else if (command.equals("usercount")) { // get number of useraccounts counter
Manager secMgr = ManagerFactory.getManager();