User: juhalindfors
Date: 01/04/22 06:13:09
Modified: src/org/jboss/admin/monitor InvocationTimeStatsView.java
Log:
Deal with the aggregated invocation events.
Revision Changes Path
1.2 +18 -6 admin/src/org/jboss/admin/monitor/InvocationTimeStatsView.java
Index: InvocationTimeStatsView.java
===================================================================
RCS file:
/cvsroot/jboss/admin/src/org/jboss/admin/monitor/InvocationTimeStatsView.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- InvocationTimeStatsView.java 2001/04/18 15:03:16 1.1
+++ InvocationTimeStatsView.java 2001/04/22 13:13:09 1.2
@@ -15,6 +15,7 @@
// non-standard class dependencies
import org.jboss.admin.monitor.event.GraphModelListener;
import org.jboss.admin.monitor.event.GraphModelEvent;
+import org.jboss.admin.monitor.event.AggregatedInvocationEvent;
import org.hs.jfc.FormPanel;
import org.gjt.lindfors.util.LocalizationSupport;
@@ -71,19 +72,30 @@
*
*************************************************************************
*/
-
+
public void valueAppended(GraphModelEvent evt) {
- int value = (int)evt.getValue();
-
+ double value = evt.getValue();
+
// Ignore zero additions; there will be lots of these if the
// continuous graph update is being used, no need to count them
- if (value <= 0)
+ if (value <= 0.0)
return;
+
+ // invocation graph model may send aggregated invocation event
+ // in case of heavy load, they require slightly different handling
+ if (evt instanceof AggregatedInvocationEvent) {
+ AggregatedInvocationEvent event = (AggregatedInvocationEvent)evt;
- ++totalInvocations;
- totalInvocationTime += value;
+ totalInvocations += event.getInvocationCount();
+ totalInvocationTime += (int)event.getSumValue();
+ }
+ else {
+ ++totalInvocations;
+ totalInvocationTime += (int)value;
+ }
+ // [TODO] format
averageTime.setText(String.valueOf(totalInvocationTime / totalInvocations));
averageTime.repaint();
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development