jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1765366 - in /jmeter/trunk/src/core/org/apache/jmeter/report/core: Sample.java SampleMetadata.java
Date Mon, 17 Oct 2016 20:11:29 GMT
Author: pmouawad
Date: Mon Oct 17 20:11:29 2016
New Revision: 1765366

URL: http://svn.apache.org/viewvc?rev=1765366&view=rev
Log:
60250 : Report / Dashboard : Need to Add Sent KB/s in Statistics Report of HTML Dashboard
Avoid failure when reading a 3.0 file with default configuration.
Default sent_bytes to 0
Default connect to 0

Bugzilla Id: 60250

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/report/core/Sample.java
    jmeter/trunk/src/core/org/apache/jmeter/report/core/SampleMetadata.java

Modified: jmeter/trunk/src/core/org/apache/jmeter/report/core/Sample.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/report/core/Sample.java?rev=1765366&r1=1765365&r2=1765366&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/report/core/Sample.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/report/core/Sample.java Mon Oct 17 20:11:29 2016
@@ -240,10 +240,14 @@ public class Sample {
     /**
      * Gets the connect time stored in the sample.
      *
-     * @return the connect time stored in the sample
+     * @return the connect time stored in the sample or 0 is column is not in results
      */
     public long getConnectTime() {
-        return getData(long.class, CSVSaveService.CSV_CONNECT_TIME).longValue();
+        if(metadata.indexOf(CSVSaveService.CSV_CONNECT_TIME) >= 0) {
+            return getData(long.class, CSVSaveService.CSV_CONNECT_TIME).longValue();
+        } else {
+            return 0L;
+        }
     }
 
     /**
@@ -266,11 +270,15 @@ public class Sample {
 
     /**
      * Gets the number of sent bytes stored in the sample.
-     *
+     * If column is not in results, we return 0
      * @return the number of sent bytes stored in the sample
      */
     public long getSentBytes() {
-        return getData(long.class, CSVSaveService.CSV_SENT_BYTES).longValue();
+        if(metadata.indexOf(CSVSaveService.CSV_SENT_BYTES) >= 0) {
+            return getData(long.class, CSVSaveService.CSV_SENT_BYTES).longValue();
+        } else {
+            return 0L;
+        }
     }
 
     /**

Modified: jmeter/trunk/src/core/org/apache/jmeter/report/core/SampleMetadata.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/report/core/SampleMetadata.java?rev=1765366&r1=1765365&r2=1765366&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/report/core/SampleMetadata.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/report/core/SampleMetadata.java Mon Oct 17 20:11:29
2016
@@ -101,6 +101,9 @@ public class SampleMetadata {
         if (saveConfig.saveBytes()) {
             configuredColumns.add(CSVSaveService.CSV_BYTES);
         }
+        if (saveConfig.saveSentBytes()) {
+            configuredColumns.add(CSVSaveService.CSV_SENT_BYTES);
+        }
         if (saveConfig.saveThreadCounts()) {
             configuredColumns.add(CSVSaveService.CSV_THREAD_COUNT1);
             configuredColumns.add(CSVSaveService.CSV_THREAD_COUNT2);



Mime
View raw message