geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akulshresh...@apache.org
Subject svn commit: r503407 - /geronimo/server/trunk/modules/geronimo-management/src/main/java/org/apache/geronimo/management/stats/
Date Sun, 04 Feb 2007 13:57:40 GMT
Author: akulshreshtha
Date: Sun Feb  4 05:57:40 2007
New Revision: 503407

URL: http://svn.apache.org/viewvc?view=rev&rev=503407
Log:
GERONIMO-2517 Added toString to *StatisticImpl
              added setStartTime and setLastSampleTime to StatsImpl to set all the values
at once

Modified:
    geronimo/server/trunk/modules/geronimo-management/src/main/java/org/apache/geronimo/management/stats/BoundaryStatisticImpl.java
    geronimo/server/trunk/modules/geronimo-management/src/main/java/org/apache/geronimo/management/stats/BoundedRangeStatisticImpl.java
    geronimo/server/trunk/modules/geronimo-management/src/main/java/org/apache/geronimo/management/stats/CountStatisticImpl.java
    geronimo/server/trunk/modules/geronimo-management/src/main/java/org/apache/geronimo/management/stats/RangeStatisticImpl.java
    geronimo/server/trunk/modules/geronimo-management/src/main/java/org/apache/geronimo/management/stats/StatisticImpl.java
    geronimo/server/trunk/modules/geronimo-management/src/main/java/org/apache/geronimo/management/stats/StatsImpl.java
    geronimo/server/trunk/modules/geronimo-management/src/main/java/org/apache/geronimo/management/stats/TimeStatisticImpl.java

Modified: geronimo/server/trunk/modules/geronimo-management/src/main/java/org/apache/geronimo/management/stats/BoundaryStatisticImpl.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-management/src/main/java/org/apache/geronimo/management/stats/BoundaryStatisticImpl.java?view=diff&rev=503407&r1=503406&r2=503407
==============================================================================
--- geronimo/server/trunk/modules/geronimo-management/src/main/java/org/apache/geronimo/management/stats/BoundaryStatisticImpl.java
(original)
+++ geronimo/server/trunk/modules/geronimo-management/src/main/java/org/apache/geronimo/management/stats/BoundaryStatisticImpl.java
Sun Feb  4 05:57:40 2007
@@ -63,4 +63,8 @@
     public void setLowerBound(long lowerBound) {
         this.lowerBound = lowerBound;
     }
+    
+    public String toString() {
+        return(getName() + " in " + getUnit() + " -- lowerBound: " + lowerBound + ", upperBound:
" + upperBound);
+    }
 }

Modified: geronimo/server/trunk/modules/geronimo-management/src/main/java/org/apache/geronimo/management/stats/BoundedRangeStatisticImpl.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-management/src/main/java/org/apache/geronimo/management/stats/BoundedRangeStatisticImpl.java?view=diff&rev=503407&r1=503406&r2=503407
==============================================================================
--- geronimo/server/trunk/modules/geronimo-management/src/main/java/org/apache/geronimo/management/stats/BoundedRangeStatisticImpl.java
(original)
+++ geronimo/server/trunk/modules/geronimo-management/src/main/java/org/apache/geronimo/management/stats/BoundedRangeStatisticImpl.java
Sun Feb  4 05:57:40 2007
@@ -65,4 +65,10 @@
             upperBound = current;
         }
     }
+    
+    public String toString() {
+        return(getName() + " in " + getUnit() + " -- lowerBound: " + lowerBound + ", upperBound:
" +
+                ", current: " + getCurrent() + ", highWaterMark: " + getHighWaterMark() +

+                ", lowWaterMark: " + getLowWaterMark());
+    }
 }

Modified: geronimo/server/trunk/modules/geronimo-management/src/main/java/org/apache/geronimo/management/stats/CountStatisticImpl.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-management/src/main/java/org/apache/geronimo/management/stats/CountStatisticImpl.java?view=diff&rev=503407&r1=503406&r2=503407
==============================================================================
--- geronimo/server/trunk/modules/geronimo-management/src/main/java/org/apache/geronimo/management/stats/CountStatisticImpl.java
(original)
+++ geronimo/server/trunk/modules/geronimo-management/src/main/java/org/apache/geronimo/management/stats/CountStatisticImpl.java
Sun Feb  4 05:57:40 2007
@@ -40,4 +40,8 @@
     public void setCount(long count) {
         this.count = count;
     }
+    
+    public String toString() {
+        return (getName() + " in " + getUnit() + " -- count: " + count);
+    }
 }

Modified: geronimo/server/trunk/modules/geronimo-management/src/main/java/org/apache/geronimo/management/stats/RangeStatisticImpl.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-management/src/main/java/org/apache/geronimo/management/stats/RangeStatisticImpl.java?view=diff&rev=503407&r1=503406&r2=503407
==============================================================================
--- geronimo/server/trunk/modules/geronimo-management/src/main/java/org/apache/geronimo/management/stats/RangeStatisticImpl.java
(original)
+++ geronimo/server/trunk/modules/geronimo-management/src/main/java/org/apache/geronimo/management/stats/RangeStatisticImpl.java
Sun Feb  4 05:57:40 2007
@@ -64,4 +64,9 @@
     public void setLowWaterMark(long lowWaterMark) {
         this.lowWaterMark = lowWaterMark;
     }
+    
+    public String toString() {
+        return(getName() + " in " + getUnit() + " -- current: " + current + ", highWaterMark:
" + highWaterMark + 
+                ", lowWaterMark: " + lowWaterMark);
+    }
 }

Modified: geronimo/server/trunk/modules/geronimo-management/src/main/java/org/apache/geronimo/management/stats/StatisticImpl.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-management/src/main/java/org/apache/geronimo/management/stats/StatisticImpl.java?view=diff&rev=503407&r1=503406&r2=503407
==============================================================================
--- geronimo/server/trunk/modules/geronimo-management/src/main/java/org/apache/geronimo/management/stats/StatisticImpl.java
(original)
+++ geronimo/server/trunk/modules/geronimo-management/src/main/java/org/apache/geronimo/management/stats/StatisticImpl.java
Sun Feb  4 05:57:40 2007
@@ -37,7 +37,8 @@
     public final static String UNIT_MEMORY_KILOBYTES = "KILOBYTE";
     public final static String UNIT_MEMORY_MEGABYTES = "MEGABYTE";
     public final static String UNIT_MEMORY_GIGABYTES = "GIGABYTE";
-    public final static String UNIT_COUNT = "COUNT";
+    // need a better name for this
+    public final static String UNIT_COUNT = "UNITCOUNT";
 
     private String name;
     private String unit;

Modified: geronimo/server/trunk/modules/geronimo-management/src/main/java/org/apache/geronimo/management/stats/StatsImpl.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-management/src/main/java/org/apache/geronimo/management/stats/StatsImpl.java?view=diff&rev=503407&r1=503406&r2=503407
==============================================================================
--- geronimo/server/trunk/modules/geronimo-management/src/main/java/org/apache/geronimo/management/stats/StatsImpl.java
(original)
+++ geronimo/server/trunk/modules/geronimo-management/src/main/java/org/apache/geronimo/management/stats/StatsImpl.java
Sun Feb  4 05:57:40 2007
@@ -31,12 +31,12 @@
  * @version $Rev$ $Date$
  */
 public class StatsImpl implements Stats, Serializable {
-    private final Map stats = new HashMap();
+    private final Map <String,StatisticImpl> stats = new HashMap<String,StatisticImpl>();
 
     public StatsImpl() {
     }
 
-    protected void addStat(String name, Statistic value) {
+    protected void addStat(String name, StatisticImpl value) {
         stats.put(name, value);
     }
 
@@ -48,6 +48,20 @@
      */
     protected void removeStat(String name) {
         stats.remove(name);
+    }
+
+    public void setStartTime() {
+        long now = System.currentTimeMillis();
+        for (StatisticImpl item : stats.values()) {
+            item.setStartTime(now);
+        }            
+    }
+    
+    public void setLastSampleTime() {
+        long now = System.currentTimeMillis();
+        for (StatisticImpl item : stats.values()) {
+            item.setLastSampleTime(now);
+        }            
     }
 
     public Statistic getStatistic(String statisticName) {

Modified: geronimo/server/trunk/modules/geronimo-management/src/main/java/org/apache/geronimo/management/stats/TimeStatisticImpl.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-management/src/main/java/org/apache/geronimo/management/stats/TimeStatisticImpl.java?view=diff&rev=503407&r1=503406&r2=503407
==============================================================================
--- geronimo/server/trunk/modules/geronimo-management/src/main/java/org/apache/geronimo/management/stats/TimeStatisticImpl.java
(original)
+++ geronimo/server/trunk/modules/geronimo-management/src/main/java/org/apache/geronimo/management/stats/TimeStatisticImpl.java
Sun Feb  4 05:57:40 2007
@@ -62,4 +62,9 @@
     public void setTotalTime(long totalTime) {
         this.totalTime = totalTime;
     }
+    
+    public String toString() {
+        return(getName() + " in " + getUnit() + " -- count: " + count + ", minTime: " + minTime
+ ", maxTime: " + maxTime + 
+                ", totalTime: " + totalTime);
+    }
 }



Mime
View raw message