jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From milam...@apache.org
Subject svn commit: r1421273 - in /jmeter/trunk: src/components/org/apache/jmeter/visualizers/RespTimeGraphVisualizer.java xdocs/changes.xml
Date Thu, 13 Dec 2012 13:01:13 GMT
Author: milamber
Date: Thu Dec 13 13:01:12 2012
New Revision: 1421273

URL: http://svn.apache.org/viewvc?rev=1421273&view=rev
Log:
Incorrect Timestamp in Response Time Graph when using a date with time in Date format field
Bugzilla Id: 54287

Modified:
    jmeter/trunk/src/components/org/apache/jmeter/visualizers/RespTimeGraphVisualizer.java
    jmeter/trunk/xdocs/changes.xml

Modified: jmeter/trunk/src/components/org/apache/jmeter/visualizers/RespTimeGraphVisualizer.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/visualizers/RespTimeGraphVisualizer.java?rev=1421273&r1=1421272&r2=1421273&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/visualizers/RespTimeGraphVisualizer.java
(original)
+++ jmeter/trunk/src/components/org/apache/jmeter/visualizers/RespTimeGraphVisualizer.java
Thu Dec 13 13:01:12 2012
@@ -169,9 +169,9 @@ public class RespTimeGraphVisualizer ext
     private final JLabeledTextField graphHeight =
             new JLabeledTextField(JMeterUtils.getResString("aggregate_graph_height"), 6);
//$NON-NLS-1$
 
-    private int minStartTime = Integer.MAX_VALUE;
+    private long minStartTime = Long.MAX_VALUE;
 
-    private int maxStartTime = Integer.MIN_VALUE;
+    private long maxStartTime = Long.MIN_VALUE;
 
     /**
      * We want to retain insertion order, so LinkedHashMap is necessary
@@ -181,9 +181,9 @@ public class RespTimeGraphVisualizer ext
     /**
      * We want to retain insertion order, so LinkedHashMap is necessary
      */
-    private final Map<String, Map<Integer, Long>> pList = new LinkedHashMap<String,
Map<Integer, Long>>();
+    private final Map<String, Map<Long, Long>> pList = new LinkedHashMap<String,
Map<Long, Long>>();
 
-    private int durationTest = 0;
+    private long durationTest = 0;
     
     private int colorIdx = 0;
 
@@ -213,7 +213,7 @@ public class RespTimeGraphVisualizer ext
         }
         if ((matcher == null) || (matcher.find())) {
             final long startTimeMS = sampleResult.getStartTime();
-            final int startTimeInterval = (int) startTimeMS / intervalValue;
+            final long startTimeInterval = startTimeMS / intervalValue;
             JMeterUtils.runSafe(new Runnable() {
                 @Override
                 public void run() {
@@ -234,18 +234,18 @@ public class RespTimeGraphVisualizer ext
                             }
                         }
                         // List of value by sampler
-                        Map<Integer, Long> subList = pList.get(sampleLabel);
+                        Map<Long, Long> subList = pList.get(sampleLabel);
                         if (subList != null) {
                             long respTime = sampleResult.getTime();
-                            Long value = subList.get(Integer.valueOf(startTimeInterval));
+                            Long value = subList.get(startTimeInterval);
                             if (value!=null) {
                                 respTime = (value.longValue() + respTime) / 2;
                             }
-                            subList.put(Integer.valueOf(startTimeInterval), Long.valueOf(respTime));
+                            subList.put(startTimeInterval, Long.valueOf(respTime));
                         } else {
                             // We want to retain insertion order, so LinkedHashMap is necessary
-                            Map<Integer, Long> newSubList = new LinkedHashMap<Integer,
Long>();
-                            newSubList.put(Integer.valueOf(startTimeInterval), Long.valueOf(sampleResult.getTime()));
+                            Map<Long, Long> newSubList = new LinkedHashMap<Long,
Long>();
+                            newSubList.put(startTimeInterval, Long.valueOf(sampleResult.getTime()));
                             pList.put(sampleLabel, newSubList);
                         }
                     }
@@ -307,7 +307,7 @@ public class RespTimeGraphVisualizer ext
      */
     public double[][] getData() {
         int size = pList.size();
-        int max = durationTest;
+        int max = (int) durationTest; // Test can't have a duration more than 2^31 secs (cast
from long to int)
 
         double[][] data = new double[size][max];
 
@@ -315,11 +315,11 @@ public class RespTimeGraphVisualizer ext
         double nanBegin = 0;
         List<Double> nanList = new ArrayList<Double>();
         int s = 0;
-        for (Map<Integer, Long> subList : pList.values()) {
+        for (Map<Long, Long> subList : pList.values()) {
             int idx = 0;
             while (idx < durationTest) {
-                int keyShift = minStartTime + idx;
-                Long value = subList.get(Integer.valueOf(keyShift));
+                long keyShift = minStartTime + idx;
+                Long value = subList.get(keyShift);
                 if (value != null) {
                     nanLast = value.doubleValue();
                     data[s][idx] = nanLast;
@@ -541,7 +541,7 @@ public class RespTimeGraphVisualizer ext
 
     public String[] getXAxisLabels() {
         SimpleDateFormat formatter = new SimpleDateFormat(xAxisTimeFormat.getText()); //$NON-NLS-1$

-        String[] xAxisLabels = new String[durationTest];
+        String[] xAxisLabels = new String[(int) durationTest]; // Test can't have a duration
more than 2^31 secs (cast from long to int)
         for (int j = 0; j < durationTest; j++) {
             xAxisLabels[j] = formatter.format(new Date((minStartTime + j) * intervalValue));
         }

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1421273&r1=1421272&r2=1421273&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml (original)
+++ jmeter/trunk/xdocs/changes.xml Thu Dec 13 13:01:12 2012
@@ -132,6 +132,7 @@ and right angle bracket (&gt;) in search
 <ul>
 <li><bugzilla>54088</bugzilla> - The type video/f4m is text, not binary</li>
 <li><bugzilla>54166</bugzilla> - ViewResultsTree could not render the HTML
response: handle failure to parse HTML</li>
+<li><bugzilla>54287</bugzilla> - Incorrect Timestamp in Response Time Graph
when using a date with time in Date format field</li>
 </ul>
 
 <h3>Timers, Assertions, Config, Pre- &amp; Post-Processors</h3>



Mime
View raw message