Author: degenaro
Date: Tue Jun  4 14:20:27 2013
New Revision: 1489453

URL: http://svn.apache.org/r1489453
Log:
UIMA-2902 Performance Metrics reporting compatible with old and new UIMA jars

Modified:
    
uima/sandbox/uima-ducc/trunk/uima-ducc-transport/src/main/java/org/apache/uima/ducc/transport/event/jd/PerformanceMetricsSummaryItem.java
    
uima/sandbox/uima-ducc/trunk/uima-ducc-transport/src/main/java/org/apache/uima/ducc/transport/event/jd/PerformanceMetricsSummaryMap.java
    
uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccHandler.java

Modified: 
uima/sandbox/uima-ducc/trunk/uima-ducc-transport/src/main/java/org/apache/uima/ducc/transport/event/jd/PerformanceMetricsSummaryItem.java
URL: 
http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-transport/src/main/java/org/apache/uima/ducc/transport/event/jd/PerformanceMetricsSummaryItem.java?rev=1489453&r1=1489452&r2=1489453&view=diff
==============================================================================
--- 
uima/sandbox/uima-ducc/trunk/uima-ducc-transport/src/main/java/org/apache/uima/ducc/transport/event/jd/PerformanceMetricsSummaryItem.java
 (original)
+++ 
uima/sandbox/uima-ducc/trunk/uima-ducc-transport/src/main/java/org/apache/uima/ducc/transport/event/jd/PerformanceMetricsSummaryItem.java
 Tue Jun  4 14:20:27 2013
@@ -61,6 +61,28 @@ public class PerformanceMetricsSummaryIt
                return name;
        }
        
+       public static String delim_old = PerformanceMetricsSummaryMap.delim_old;
+       public static String delim_new = PerformanceMetricsSummaryMap.delim_new;
+       
+       public String getDisplayName() {
+               String itemName = getName();
+               String displayName = itemName;
+               try {
+                       if(itemName.contains(delim_old)) {
+                               displayName = itemName.split(delim_old,2)[1];
+                       }
+                       else if(itemName.contains(delim_new)) {
+                               displayName = itemName.split(delim_new,2)[1];
+                       }
+                       else {
+                               displayName = itemName;
+                       }
+               }
+               catch(Throwable t) {
+               }
+               return displayName;
+       }
+       
        public String getUniqueName() {
                return uniqueName;
        }

Modified: 
uima/sandbox/uima-ducc/trunk/uima-ducc-transport/src/main/java/org/apache/uima/ducc/transport/event/jd/PerformanceMetricsSummaryMap.java
URL: 
http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-transport/src/main/java/org/apache/uima/ducc/transport/event/jd/PerformanceMetricsSummaryMap.java?rev=1489453&r1=1489452&r2=1489453&view=diff
==============================================================================
--- 
uima/sandbox/uima-ducc/trunk/uima-ducc-transport/src/main/java/org/apache/uima/ducc/transport/event/jd/PerformanceMetricsSummaryMap.java
 (original)
+++ 
uima/sandbox/uima-ducc/trunk/uima-ducc-transport/src/main/java/org/apache/uima/ducc/transport/event/jd/PerformanceMetricsSummaryMap.java
 Tue Jun  4 14:20:27 2013
@@ -40,9 +40,9 @@ public class PerformanceMetricsSummaryMa
 
        private AtomicInteger casCount = new AtomicInteger(0);
        
-       public String delim_old = "Components,";
-       public String delim_new = " Components ";
-       public String delim     = delim_new;
+       public static String delim_old = "Components,";
+       public static String delim_new = " Components ";
+       public static String delim     = delim_new;
        
        private String getKey(AnalysisEnginePerformanceMetrics item) {
                String key = "?";

Modified: 
uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccHandler.java
URL: 
http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccHandler.java?rev=1489453&r1=1489452&r2=1489453&view=diff
==============================================================================
--- 
uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccHandler.java
 (original)
+++ 
uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccHandler.java
 Tue Jun  4 14:20:27 2013
@@ -1228,22 +1228,12 @@ public class DuccHandler extends DuccAbs
                                        
sb.append("Max<br><small>hh:mm:ss/workitem</small>");
                                        sb.append("</th>");
                                        sb.append("</tr>");
-                               
-                                       String prefix = "name=";
-                                       
                                        ArrayList <UimaStatistic> uimaStats = 
new ArrayList<UimaStatistic>();
                                    uimaStats.clear();
                                    //long analysisTime = 0;
                                    for (Entry<String, 
PerformanceMetricsSummaryItem> entry : performanceMetricsSummaryMap.entrySet()) 
{
                                        PerformanceMetricsSummaryItem item = 
entry.getValue();
-                                       String shortname = item.getName();
-                                       if(shortname != null) {
-                                               shortname = shortname.trim();
-                                               
if(shortname.startsWith(prefix)) {
-                                                       String[] divided = 
shortname.split(prefix,2);
-                                                       shortname = divided[1];
-                                               }
-                                       }
+                                       String shortname = 
item.getDisplayName();
                                        long anTime = item.getAnalysisTime();
                                        long anMinTime = 
item.getAnalysisTimeMin();
                                        long anMaxTime = 
item.getAnalysisTimeMax();


Reply via email to