Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report / Dashboard : Bytes throughput Over Time has reversed Sent and Received bytes #4092

Closed
asfimport opened this issue Sep 6, 2016 · 2 comments

Comments

@asfimport
Copy link
Collaborator

UbikLoadPack support (Bug 60089):
In Bytes throughput Over Time, sent bytes is in fact received bytes and received bytes contains sent bytes (which is for now an unavailable metric).

Severity: normal
OS: All

@asfimport
Copy link
Collaborator Author

UbikLoadPack support (migrated from Bugzilla):
Created attachment BUG_60089.patch: Patch fixing the bug

BUG_60089.patch
Index: src/core/org/apache/jmeter/report/core/Sample.java
===================================================================
--- src/core/org/apache/jmeter/report/core/Sample.java	(revision 1759441)
+++ src/core/org/apache/jmeter/report/core/Sample.java	(working copy)
@@ -254,12 +254,22 @@
     }
 
     /**
+     * Gets the number of received bytes stored in the sample.
+     *
+     * @return the number of received bytes stored in the sample
+     */
+    public int getReceivedBytes() {
+        return getData(int.class, CSVSaveService.CSV_BYTES).intValue();
+    }
+    
+    /**
      * Gets the number of sent bytes stored in the sample.
      *
      * @return the number of sent bytes stored in the sample
      */
     public int getSentBytes() {
-        return getData(int.class, CSVSaveService.CSV_BYTES).intValue();
+        // TODO To implement when metric is available
+        return 0;
     }
 
     /**
Index: src/core/org/apache/jmeter/report/processor/StatisticsSummaryConsumer.java
===================================================================
--- src/core/org/apache/jmeter/report/processor/StatisticsSummaryConsumer.java	(revision 1759441)
+++ src/core/org/apache/jmeter/report/processor/StatisticsSummaryConsumer.java	(working copy)
@@ -48,6 +48,7 @@
 
     void aggregateSample(Sample sample, StatisticsSummaryData data) {
         data.incTotal();
+        data.incBytes(sample.getReceivedBytes());
         data.incBytes(sample.getSentBytes());
 
         if (!sample.getSuccess()) {
Index: src/core/org/apache/jmeter/report/processor/graph/impl/BytesThroughputGraphConsumer.java
===================================================================
--- src/core/org/apache/jmeter/report/processor/graph/impl/BytesThroughputGraphConsumer.java	(revision 1759441)
+++ src/core/org/apache/jmeter/report/processor/graph/impl/BytesThroughputGraphConsumer.java	(working copy)
@@ -78,9 +78,8 @@
 
                     @Override
                     public double select(String series, Sample sample) {
-                        // TODO Add Received bytes support
-                        return (SENT_BYTES_SERIES_LABEL.equals(series)) ? sample
-                                .getSentBytes() : 0;
+                        return (RECEIVED_BYTES_SERIES_LABEL.equals(series)) ? sample
+                                .getReceivedBytes() : sample.getSentBytes();
                     }
                 }, false, false));
         return groupInfos;

@asfimport
Copy link
Collaborator Author

@pmouawad (migrated from Bugzilla):
Author: pmouawad
Date: Tue Sep 6 15:45:38 2016
New Revision: 1759448

URL: http://svn.apache.org/viewvc?rev=1759448&view=rev
Log:
#4092 Report / Dashboard : Bytes throughput Over Time has reversed Sent and Received bytes
Contributed by Ubik Load Pack (support at ubikloadpack.com)
#4092

Modified:
jmeter/trunk/src/core/org/apache/jmeter/report/core/Sample.java
jmeter/trunk/src/core/org/apache/jmeter/report/processor/StatisticsSummaryConsumer.java
jmeter/trunk/src/core/org/apache/jmeter/report/processor/graph/impl/BytesThroughputGraphConsumer.java
jmeter/trunk/xdocs/changes.xml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant