[jboss-cvs] jboss-profiler/java/src/expansion/org/jboss/profiler/exp/agent/collector ...

Takuro Okada t2-okada at nri.co.jp
Tue Oct 31 06:25:48 EST 2006


  User: tokada  
  Date: 06/10/31 06:25:48

  Modified:    java/src/expansion/org/jboss/profiler/exp/agent/collector     
                        Tag: JBossProfiler_Expansion MetricCollector.java
                        ScaleMetricCollector.java
                        ThreadMetricCollector.java
                        TimeScaleMetricCollector.java
                        StackMetricCollector.java
  Log:
  Added some interfaces for the persistor.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.2   +2 -2      jboss-profiler/java/src/expansion/org/jboss/profiler/exp/agent/collector/Attic/MetricCollector.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: MetricCollector.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-profiler/java/src/expansion/org/jboss/profiler/exp/agent/collector/Attic/MetricCollector.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -b -r1.1.2.1 -r1.1.2.2
  --- MetricCollector.java	26 Oct 2006 08:58:56 -0000	1.1.2.1
  +++ MetricCollector.java	31 Oct 2006 11:25:48 -0000	1.1.2.2
  @@ -23,9 +23,9 @@
   package org.jboss.profiler.exp.agent.collector;
   
   import java.io.Serializable;
  -import java.util.Map;
   
   import org.jboss.profiler.exp.agent.collector.model.MetricName;
  +import org.jboss.profiler.exp.agent.collector.model.MetricsMap;
   
   /**
    * This interface temporarily keeps the metric value and replaces it to the persistent object.
  @@ -74,6 +74,6 @@
        * Sets the map object of entity for replacement.
        * @param metricMap - persistent object
        */
  -    void setMetricsMap(Map metricMap);
  +    void setMetricsMap(MetricsMap metricsMap);
   
   }
  
  
  
  1.1.2.2   +11 -10    jboss-profiler/java/src/expansion/org/jboss/profiler/exp/agent/collector/Attic/ScaleMetricCollector.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ScaleMetricCollector.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-profiler/java/src/expansion/org/jboss/profiler/exp/agent/collector/Attic/ScaleMetricCollector.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -b -r1.1.2.1 -r1.1.2.2
  --- ScaleMetricCollector.java	26 Oct 2006 08:58:56 -0000	1.1.2.1
  +++ ScaleMetricCollector.java	31 Oct 2006 11:25:48 -0000	1.1.2.2
  @@ -26,7 +26,9 @@
   import java.util.HashMap;
   import java.util.Map;
   
  +import org.jboss.profiler.exp.agent.collector.model.Metric;
   import org.jboss.profiler.exp.agent.collector.model.MetricName;
  +import org.jboss.profiler.exp.agent.collector.model.MetricsMap;
   import org.jboss.profiler.exp.agent.collector.model.ScaleMetric;
   import org.jboss.profiler.exp.util.HierarchicalMap;
   
  @@ -45,7 +47,7 @@
       
       private Map<MetricName, Long> localStats = null;
       
  -    private Map<String, Map<String, Map<MetricName, ScaleMetric>>> metricsMap = null;
  +    private MetricsMap metricsMap = null;
       
       public ScaleMetricCollector(String category, String operationName) {
           this.category = category;
  @@ -73,29 +75,28 @@
           localStats.remove(metricName);
       }
       
  -    @SuppressWarnings("unchecked")
  -    public void setMetricsMap(Map metricMap) {
  -        this.metricsMap = metricMap;
  +    public void setMetricsMap(MetricsMap metricsMap) {
  +        this.metricsMap = metricsMap;
       }
   
       public void run() {
  -        Map<MetricName, ScaleMetric> mmap = null;
  +        Map<MetricName, Metric> mmap = null;
           if(metricsMap.containsKey(category)) {
  -            Map<String, Map<MetricName, ScaleMetric>> omap = metricsMap.get(category);
  +            Map<String, Map<MetricName, Metric>> omap = metricsMap.get(category);
               mmap = omap.get(operationName);
               if(mmap==null) {
  -                mmap = new EnumMap<MetricName, ScaleMetric>(MetricName.class);
  +                mmap = new EnumMap<MetricName, Metric>(MetricName.class);
                   omap.put(operationName, mmap);
               }
           }else {
  -            mmap = new EnumMap<MetricName, ScaleMetric>(MetricName.class);
  -            Map<String, Map<MetricName, ScaleMetric>> omap = new HierarchicalMap<String, Map<MetricName, ScaleMetric>>();
  +            mmap = new EnumMap<MetricName, Metric>(MetricName.class);
  +            Map<String, Map<MetricName, Metric>> omap = new HierarchicalMap<String, Map<MetricName, Metric>>();
               omap.put(operationName, mmap);
               metricsMap.put(category, omap);
           }
           for(Map.Entry<MetricName, Long> localStat : localStats.entrySet()) {
               MetricName key = localStat.getKey();
  -            ScaleMetric metric = mmap.get(key);
  +            ScaleMetric metric = (ScaleMetric)mmap.get(key);
               if(metric==null) {
                   metric = new ScaleMetric();
                   mmap.put(localStat.getKey(), metric);
  
  
  
  1.1.2.2   +12 -11    jboss-profiler/java/src/expansion/org/jboss/profiler/exp/agent/collector/Attic/ThreadMetricCollector.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ThreadMetricCollector.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-profiler/java/src/expansion/org/jboss/profiler/exp/agent/collector/Attic/ThreadMetricCollector.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -b -r1.1.2.1 -r1.1.2.2
  --- ThreadMetricCollector.java	26 Oct 2006 08:58:56 -0000	1.1.2.1
  +++ ThreadMetricCollector.java	31 Oct 2006 11:25:48 -0000	1.1.2.2
  @@ -26,7 +26,9 @@
   import java.util.HashMap;
   import java.util.Map;
   
  +import org.jboss.profiler.exp.agent.collector.model.Metric;
   import org.jboss.profiler.exp.agent.collector.model.MetricName;
  +import org.jboss.profiler.exp.agent.collector.model.MetricsMap;
   import org.jboss.profiler.exp.agent.collector.model.ThreadMetric;
   import org.jboss.profiler.exp.util.HierarchicalMap;
   
  @@ -50,7 +52,7 @@
       
       private Map<MetricName, Long> localStats = null;
       
  -    private Map<String, Map<String, Map<MetricName, ThreadMetric>>> metricsMap = null;
  +    private MetricsMap metricsMap = null;
       
       // TODO Remove a external file.
       private static Map<String, String> IMPLEMENTATION_MAP = new HashMap<String, String>();
  @@ -98,9 +100,8 @@
           this.stackTrace = stackTrace;
       }
   
  -    @SuppressWarnings("unchecked")
  -    public void setMetricsMap(Map metricMap) {
  -        this.metricsMap = metricMap;
  +    public void setMetricsMap(MetricsMap metricsMap) {
  +        this.metricsMap = metricsMap;
       }
       
       @Override
  @@ -130,23 +131,23 @@
       }
   
       public void run() {
  -        Map<MetricName, ThreadMetric> mmap = null;
  +        Map<MetricName, Metric> mmap = null;
           if(metricsMap.containsKey(category)) {
  -            Map<String, Map<MetricName, ThreadMetric>> omap = metricsMap.get(category);
  +            Map<String, Map<MetricName, Metric>> omap = metricsMap.get(category);
               mmap = omap.get(String.valueOf(threadId));
               if(mmap==null) {
  -                mmap = new EnumMap<MetricName, ThreadMetric>(MetricName.class);
  +                mmap = new EnumMap<MetricName, Metric>(MetricName.class);
                   omap.put(String.valueOf(threadId), mmap);
               }
           }else {
  -            mmap = new EnumMap<MetricName, ThreadMetric>(MetricName.class);
  -            Map<String, Map<MetricName, ThreadMetric>> omap = new HierarchicalMap<String, Map<MetricName, ThreadMetric>>();
  +            mmap = new EnumMap<MetricName, Metric>(MetricName.class);
  +            Map<String, Map<MetricName, Metric>> omap = new HierarchicalMap<String, Map<MetricName, Metric>>();
               omap.put(String.valueOf(threadId), mmap);
               metricsMap.put(category, omap);
           }
           for(Map.Entry<MetricName, Long> localStat : localStats.entrySet()) {
               MetricName key = localStat.getKey();
  -            ThreadMetric metric = mmap.get(key);
  +            ThreadMetric metric = (ThreadMetric)mmap.get(key);
               if(metric==null) {
                   metric = new ThreadMetric();
                   mmap.put(localStat.getKey(), metric);
  
  
  
  1.1.2.2   +11 -10    jboss-profiler/java/src/expansion/org/jboss/profiler/exp/agent/collector/Attic/TimeScaleMetricCollector.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: TimeScaleMetricCollector.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-profiler/java/src/expansion/org/jboss/profiler/exp/agent/collector/Attic/TimeScaleMetricCollector.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -b -r1.1.2.1 -r1.1.2.2
  --- TimeScaleMetricCollector.java	26 Oct 2006 08:58:56 -0000	1.1.2.1
  +++ TimeScaleMetricCollector.java	31 Oct 2006 11:25:48 -0000	1.1.2.2
  @@ -26,7 +26,9 @@
   import java.util.HashMap;
   import java.util.Map;
   
  +import org.jboss.profiler.exp.agent.collector.model.Metric;
   import org.jboss.profiler.exp.agent.collector.model.MetricName;
  +import org.jboss.profiler.exp.agent.collector.model.MetricsMap;
   import org.jboss.profiler.exp.agent.collector.model.TimeScaleMetric;
   import org.jboss.profiler.exp.util.HierarchicalMap;
   
  @@ -45,7 +47,7 @@
       
       private Map<MetricName, Long> localStats = null;
       
  -    private Map<String, Map<String, Map<MetricName, TimeScaleMetric>>> metricsMap = null;
  +    private MetricsMap metricsMap = null;
       
       public TimeScaleMetricCollector(String category, String operationName, long timestamp, Object... args) {
           this.category = category;
  @@ -74,29 +76,28 @@
           localStats.remove(metricName);
       }
       
  -    @SuppressWarnings("unchecked")
  -    public void setMetricsMap(Map metricMap) {
  -        this.metricsMap = metricMap;
  +    public void setMetricsMap(MetricsMap metricsMap) {
  +        this.metricsMap = metricsMap;
       }
   
       public void run() {
  -        Map<MetricName, TimeScaleMetric> mmap = null;
  +        Map<MetricName, Metric> mmap = null;
           if(metricsMap.containsKey(category)) {
  -            Map<String, Map<MetricName, TimeScaleMetric>> omap = metricsMap.get(category);
  +            Map<String, Map<MetricName, Metric>> omap = metricsMap.get(category);
               mmap = omap.get(operationName);
               if(mmap==null) {
  -                mmap = new EnumMap<MetricName, TimeScaleMetric>(MetricName.class);
  +                mmap = new EnumMap<MetricName, Metric>(MetricName.class);
                   omap.put(operationName, mmap);
               }
           }else {
  -            mmap = new EnumMap<MetricName, TimeScaleMetric>(MetricName.class);
  -            Map<String, Map<MetricName, TimeScaleMetric>> omap = new HierarchicalMap<String, Map<MetricName, TimeScaleMetric>>();
  +            mmap = new EnumMap<MetricName, Metric>(MetricName.class);
  +            Map<String, Map<MetricName, Metric>> omap = new HierarchicalMap<String, Map<MetricName, Metric>>();
               omap.put(operationName, mmap);
               metricsMap.put(category, omap);
           }
           for(Map.Entry<MetricName, Long> localStat : localStats.entrySet()) {
               MetricName key = localStat.getKey();
  -            TimeScaleMetric metric = mmap.get(key);
  +            TimeScaleMetric metric = (TimeScaleMetric)mmap.get(key);
               if(metric==null) {
                   metric = new TimeScaleMetric();
                   mmap.put(localStat.getKey(), metric);
  
  
  
  1.1.2.2   +11 -10    jboss-profiler/java/src/expansion/org/jboss/profiler/exp/agent/collector/Attic/StackMetricCollector.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: StackMetricCollector.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-profiler/java/src/expansion/org/jboss/profiler/exp/agent/collector/Attic/StackMetricCollector.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -b -r1.1.2.1 -r1.1.2.2
  --- StackMetricCollector.java	26 Oct 2006 08:58:56 -0000	1.1.2.1
  +++ StackMetricCollector.java	31 Oct 2006 11:25:48 -0000	1.1.2.2
  @@ -28,7 +28,9 @@
   import java.util.List;
   import java.util.Map;
   
  +import org.jboss.profiler.exp.agent.collector.model.Metric;
   import org.jboss.profiler.exp.agent.collector.model.MetricName;
  +import org.jboss.profiler.exp.agent.collector.model.MetricsMap;
   import org.jboss.profiler.exp.agent.collector.model.StackMetric;
   import org.jboss.profiler.exp.util.HierarchicalMap;
   
  @@ -46,7 +48,7 @@
       
       private Map<MetricName, String[]> localStats = null;
       
  -    private Map<String, Map<String, Map<MetricName, StackMetric>>> metricsMap = null;
  +    private MetricsMap metricsMap = null;
       
       public StackMetricCollector(String category, String operationName) {
           this.category = category;
  @@ -77,9 +79,8 @@
           localStats.remove(metricName);
       }
       
  -    @SuppressWarnings("unchecked")
  -    public void setMetricsMap(Map metricMap) {
  -        this.metricsMap = metricMap;
  +    public void setMetricsMap(MetricsMap metricsMap) {
  +        this.metricsMap = metricsMap;
       }
       
       private String[] cutoffMethodNames(String[] source, String operationName) {
  @@ -92,23 +93,23 @@
       }
   
       public void run() {
  -        Map<MetricName, StackMetric> mmap = null;
  +        Map<MetricName, Metric> mmap = null;
           if(metricsMap.containsKey(category)) {
  -            Map<String, Map<MetricName, StackMetric>> omap = metricsMap.get(category);
  +            Map<String, Map<MetricName, Metric>> omap = metricsMap.get(category);
               mmap = omap.get(operationName);
               if(mmap==null) {
  -                mmap = new EnumMap<MetricName, StackMetric>(MetricName.class);
  +                mmap = new EnumMap<MetricName, Metric>(MetricName.class);
                   omap.put(operationName, mmap);
               }
           }else {
  -            mmap = new EnumMap<MetricName, StackMetric>(MetricName.class);
  -            Map<String, Map<MetricName, StackMetric>> omap = new HierarchicalMap<String, Map<MetricName, StackMetric>>();
  +            mmap = new EnumMap<MetricName, Metric>(MetricName.class);
  +            Map<String, Map<MetricName, Metric>> omap = new HierarchicalMap<String, Map<MetricName, Metric>>();
               omap.put(operationName, mmap);
               metricsMap.put(category, omap);
           }
           for(Map.Entry<MetricName, String[]> localStat : localStats.entrySet()) {
               MetricName key = localStat.getKey();
  -            StackMetric metric = mmap.get(key);
  +            StackMetric metric = (StackMetric)mmap.get(key);
               if(metric==null) {
                   metric = new StackMetric();
                   mmap.put(localStat.getKey(), metric);
  
  
  



More information about the jboss-cvs-commits mailing list