Author: degenaro
Date: Thu Jul 25 13:59:19 2013
New Revision: 1506972

URL: http://svn.apache.org/r1506972
Log:
UIMA-3114 DUCC webserver (WS) reports incorrect value of 0 for swap on Jobs page

Modified:
    
uima/sandbox/uima-ducc/trunk/uima-ducc-transport/src/main/java/org/apache/uima/ducc/transport/event/common/DuccWorkJob.java
    
uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccHandlerJsonFormat.java
    
uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccHandlerLegacy.java

Modified: 
uima/sandbox/uima-ducc/trunk/uima-ducc-transport/src/main/java/org/apache/uima/ducc/transport/event/common/DuccWorkJob.java
URL: 
http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-transport/src/main/java/org/apache/uima/ducc/transport/event/common/DuccWorkJob.java?rev=1506972&r1=1506971&r2=1506972&view=diff
==============================================================================
--- 
uima/sandbox/uima-ducc/trunk/uima-ducc-transport/src/main/java/org/apache/uima/ducc/transport/event/common/DuccWorkJob.java
 (original)
+++ 
uima/sandbox/uima-ducc/trunk/uima-ducc-transport/src/main/java/org/apache/uima/ducc/transport/event/common/DuccWorkJob.java
 Thu Jul 25 13:59:19 2013
@@ -23,7 +23,6 @@ import java.util.Set;
 import java.util.concurrent.atomic.AtomicLong;
 
 import org.apache.uima.ducc.common.utils.id.DuccId;
-import org.apache.uima.ducc.transport.Constants;
 import 
org.apache.uima.ducc.transport.event.common.IDuccCompletionType.JobCompletionType;
 import org.apache.uima.ducc.transport.event.common.IDuccState.JobState;
 import org.apache.uima.ducc.transport.event.common.IDuccTypes.DuccType;
@@ -405,29 +404,29 @@ public class DuccWorkJob extends ADuccWo
                IDuccProcessMap map = getProcessMap();
                if(map != null) {
                        double swap = map.getSwapUsageGb();
-                       retVal += swap/Constants.GB;
+                       retVal += swap;
                }
                DuccWorkPopDriver driver = getDriver();
                if(driver != null) {
                        map = driver.getProcessMap();
                        double swap = map.getSwapUsageGb();
-                       retVal += swap/Constants.GB;
+                       retVal += swap;
                }
                return retVal;
        }
        
        public double getSwapUsageGbMax() {
-               long retVal = 0;
+               double retVal = 0;
                IDuccProcessMap map = getProcessMap();
                if(map != null) {
                        double swap = map.getSwapUsageGbMax();
-                       retVal += swap/Constants.GB;
+                       retVal += swap;
                }
                DuccWorkPopDriver driver = getDriver();
                if(driver != null) {
                        map = driver.getProcessMap();
                        double swap = map.getSwapUsageGbMax();
-                       retVal += swap/Constants.GB;
+                       retVal += swap;
                }
                return retVal;
        }

Modified: 
uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccHandlerJsonFormat.java
URL: 
http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccHandlerJsonFormat.java?rev=1506972&r1=1506971&r2=1506972&view=diff
==============================================================================
--- 
uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccHandlerJsonFormat.java
 (original)
+++ 
uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccHandlerJsonFormat.java
 Thu Jul 25 13:59:19 2013
@@ -263,10 +263,10 @@ public class DuccHandlerJsonFormat exten
                sb.append("</span>");
                row.add(new JsonPrimitive(sb.toString()));
                // Swap
-               DecimalFormat formatter = new DecimalFormat("##0.0");
+               DecimalFormat formatter = new DecimalFormat("###0.0");
                sb = new StringBuffer();
                sb.append("<span>");
-               double swap = job.getSwapUsageGbMax();
+               double swap = job.getSwapUsageGb();
                if(job.isCompleted()) {
                        swap = job.getSwapUsageGbMax();
                }

Modified: 
uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccHandlerLegacy.java
URL: 
http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccHandlerLegacy.java?rev=1506972&r1=1506971&r2=1506972&view=diff
==============================================================================
--- 
uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccHandlerLegacy.java
 (original)
+++ 
uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/DuccHandlerLegacy.java
 Thu Jul 25 13:59:19 2013
@@ -240,9 +240,9 @@ public class DuccHandlerLegacy extends D
                sb.append(""+pgin);
                sb.append("</td>");
                // Swap
-               DecimalFormat formatter = new DecimalFormat("##0.0");
+               DecimalFormat formatter = new DecimalFormat("###0.0");
                sb.append("<td valign=\"bottom\" align=\"right\">");
-               double swap = job.getSwapUsageGbMax();
+               double swap = job.getSwapUsageGb();
                if(job.isCompleted()) {
                        swap = job.getSwapUsageGbMax();
                }


Reply via email to