jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1763984 - in /jmeter/trunk: bin/ src/components/org/apache/jmeter/visualizers/ src/core/org/apache/jmeter/control/ src/core/org/apache/jmeter/report/core/ src/core/org/apache/jmeter/resources/ src/core/org/apache/jmeter/samplers/ src/core/...
Date Sun, 09 Oct 2016 15:03:03 GMT
Author: pmouawad
Date: Sun Oct  9 15:03:03 2016
New Revision: 1763984

URL: http://svn.apache.org/viewvc?rev=1763984&view=rev
Log:
Bug 60229 - Add a new metric : sent_bytes
Bugzilla Id: 60229

Modified:
    jmeter/trunk/bin/jmeter.properties
    jmeter/trunk/src/components/org/apache/jmeter/visualizers/SamplerResultTab.java
    jmeter/trunk/src/components/org/apache/jmeter/visualizers/TableVisualizer.java
    jmeter/trunk/src/core/org/apache/jmeter/control/TransactionController.java
    jmeter/trunk/src/core/org/apache/jmeter/report/core/Sample.java
    jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties
    jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties
    jmeter/trunk/src/core/org/apache/jmeter/samplers/SampleResult.java
    jmeter/trunk/src/core/org/apache/jmeter/samplers/SampleSaveConfiguration.java
    jmeter/trunk/src/core/org/apache/jmeter/samplers/StatisticalSampleResult.java
    jmeter/trunk/src/core/org/apache/jmeter/save/CSVSaveService.java
    jmeter/trunk/src/core/org/apache/jmeter/save/converters/SampleResultConverter.java
    jmeter/trunk/src/core/org/apache/jmeter/save/converters/SampleSaveConfigurationConverter.java
    jmeter/trunk/src/core/org/apache/jmeter/visualizers/TableSample.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java
    jmeter/trunk/xdocs/changes.xml
    jmeter/trunk/xdocs/usermanual/listeners.xml

Modified: jmeter/trunk/bin/jmeter.properties
URL: http://svn.apache.org/viewvc/jmeter/trunk/bin/jmeter.properties?rev=1763984&r1=1763983&r2=1763984&view=diff
==============================================================================
--- jmeter/trunk/bin/jmeter.properties (original)
+++ jmeter/trunk/bin/jmeter.properties Sun Oct  9 15:03:03 2016
@@ -560,6 +560,7 @@ log_level.jorphan=INFO
 #jmeter.save.saveservice.requestHeaders=false
 #jmeter.save.saveservice.encoding=false
 #jmeter.save.saveservice.bytes=true
+#jmeter.save.saveservice.sent_bytes=true
 #jmeter.save.saveservice.url=false
 #jmeter.save.saveservice.filename=false
 #jmeter.save.saveservice.hostname=false

Modified: jmeter/trunk/src/components/org/apache/jmeter/visualizers/SamplerResultTab.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/visualizers/SamplerResultTab.java?rev=1763984&r1=1763983&r2=1763984&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/visualizers/SamplerResultTab.java (original)
+++ jmeter/trunk/src/components/org/apache/jmeter/visualizers/SamplerResultTab.java Sun Oct
 9 15:03:03 2016
@@ -239,6 +239,7 @@ public abstract class SamplerResultTab i
                 statsBuff.append(JMeterUtils.getResString("view_results_connect_time")).append(sampleResult.getConnectTime()).append(NL);
//$NON-NLS-1$
                 statsBuff.append(JMeterUtils.getResString("view_results_latency")).append(sampleResult.getLatency()).append(NL);
//$NON-NLS-1$
                 statsBuff.append(JMeterUtils.getResString("view_results_size_in_bytes")).append(sampleResult.getBytes()).append(NL);
//$NON-NLS-1$
+                statsBuff.append(JMeterUtils.getResString("view_results_sent_bytes")).append(sampleResult.getSentBytes()).append(NL);
//$NON-NLS-1$
                 statsBuff.append(JMeterUtils.getResString("view_results_size_headers_in_bytes")).append(sampleResult.getHeadersSize()).append(NL);
//$NON-NLS-1$
                 statsBuff.append(JMeterUtils.getResString("view_results_size_body_in_bytes")).append(sampleResult.getBodySize()).append(NL);
//$NON-NLS-1$
                 statsBuff.append(JMeterUtils.getResString("view_results_sample_count")).append(sampleResult.getSampleCount()).append(NL);
//$NON-NLS-1$

Modified: jmeter/trunk/src/components/org/apache/jmeter/visualizers/TableVisualizer.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/visualizers/TableVisualizer.java?rev=1763984&r1=1763983&r2=1763984&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/visualizers/TableVisualizer.java (original)
+++ jmeter/trunk/src/components/org/apache/jmeter/visualizers/TableVisualizer.java Sun Oct
 9 15:03:03 2016
@@ -84,6 +84,7 @@ public class TableVisualizer extends Abs
             "table_visualizer_sample_time", // $NON-NLS-1$
             "table_visualizer_status",      // $NON-NLS-1$
             "table_visualizer_bytes",       // $NON-NLS-1$
+            "table_visualizer_sent_bytes",       // $NON-NLS-1$
             "table_visualizer_latency",     // $NON-NLS-1$
             "table_visualizer_connect"};    // $NON-NLS-1$
 
@@ -137,11 +138,12 @@ public class TableVisualizer extends Abs
                 new Functor("getElapsed"),             // $NON-NLS-1$
                 new SampleSuccessFunctor("isSuccess"), // $NON-NLS-1$
                 new Functor("getBytes"),               // $NON-NLS-1$
+                new Functor("getSentBytes"),               // $NON-NLS-1$
                 new Functor("getLatency"),             // $NON-NLS-1$
                 new Functor("getConnectTime") },       // $NON-NLS-1$
-                new Functor[] { null, null, null, null, null, null, null, null, null },
+                new Functor[] { null, null, null, null, null, null, null, null, null, null
},
                 new Class[] {
-                String.class, String.class, String.class, String.class, Long.class, ImageIcon.class,
Long.class, Long.class, Long.class });
+                String.class, String.class, String.class, String.class, Long.class, ImageIcon.class,
Long.class, Long.class, Long.class, Long.class });
         init();
     }
 
@@ -193,6 +195,7 @@ public class TableVisualizer extends Abs
                             res.getTime(),
                             res.isSuccessful(),
                             res.getBytes(),
+                            res.getSentBytes(),
                             res.getLatency(),
                             res.getConnectTime()
                             );

Modified: jmeter/trunk/src/core/org/apache/jmeter/control/TransactionController.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/control/TransactionController.java?rev=1763984&r1=1763983&r2=1763984&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/control/TransactionController.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/control/TransactionController.java Sun Oct  9
15:03:03 2016
@@ -322,6 +322,7 @@ public class TransactionController exten
                 SampleResult sampleResult = se.getResult();
                 res.setThreadName(sampleResult.getThreadName());
                 res.setBytes(res.getBytes() + sampleResult.getBytes());
+                res.setSentBytes(res.getSentBytes() + sampleResult.getSentBytes());
                 if (!isIncludeTimers()) {// Accumulate waiting time for later
                     pauseTime += sampleResult.getEndTime() - sampleResult.getTime() - prevEndTime;
                     prevEndTime = sampleResult.getEndTime();

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=1763984&r1=1763983&r2=1763984&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 Sun Oct  9 15:03:03 2016
@@ -269,9 +269,8 @@ public class Sample {
      *
      * @return the number of sent bytes stored in the sample
      */
-    public int getSentBytes() {
-        // TODO To implement when metric is available
-        return 0;
+    public long getSentBytes() {
+        return getData(long.class, CSVSaveService.CSV_SENT_BYTES).longValue();
     }
 
     /**

Modified: jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties?rev=1763984&r1=1763983&r2=1763984&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties Sun Oct  9 15:03:03
2016
@@ -958,6 +958,7 @@ save_responsedata=Save Response Data (XM
 save_responseheaders=Save Response Headers (XML)
 save_samplecount=Save Sample and Error Counts
 save_samplerdata=Save Sampler Data (XML)
+save_sentbytes=Save sent bytes count
 save_subresults=Save Sub Results (XML)
 save_success=Save Success
 save_threadcounts=Save Active Thread Counts
@@ -1120,6 +1121,7 @@ table_visualizer_latency=Latency
 table_visualizer_connect=Connect Time(ms)
 table_visualizer_sample_num=Sample #
 table_visualizer_sample_time=Sample Time(ms)
+table_visualizer_sent_bytes=Sent Bytes
 table_visualizer_start_time=Start Time
 table_visualizer_status=Status
 table_visualizer_success=Success
@@ -1265,6 +1267,7 @@ view_results_response_too_large_message=
 view_results_sample_count=Sample Count: 
 view_results_sample_start=Sample Start: 
 view_results_search_pane=Search pane
+view_results_sent_bytes=Sent bytes:
 view_results_size_body_in_bytes=Body size in bytes: 
 view_results_size_headers_in_bytes=Headers size in bytes: 
 view_results_size_in_bytes=Size in bytes: 

Modified: jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties?rev=1763984&r1=1763983&r2=1763984&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties Sun Oct  9 15:03:03
2016
@@ -943,6 +943,7 @@ save_responsedata=Donn\u00E9es de r\u00E
 save_responseheaders=Ent\u00EAtes de r\u00E9ponse (XML)
 save_samplecount=Nombre d'\u00E9chantillon et d'erreur
 save_samplerdata=Donn\u00E9es d'\u00E9chantillon (XML)
+save_sentbytes=Nombre d'octets envoy\u00E9s
 save_subresults=Sous r\u00E9sultats (XML)
 save_success=Succ\u00E8s
 save_threadcounts=Nombre d'unit\u00E9s actives
@@ -1105,6 +1106,7 @@ table_visualizer_connect=\u00C9tabl. Con
 table_visualizer_latency=Latence
 table_visualizer_sample_num=Echantillon \#
 table_visualizer_sample_time=Temps (ms)
+table_visualizer_sent_bytes=Octets envoy\u00E9s
 table_visualizer_start_time=Heure d\u00E9but
 table_visualizer_status=Statut
 table_visualizer_success=Succ\u00E8s
@@ -1250,6 +1252,7 @@ view_results_response_too_large_message=
 view_results_sample_count=Compteur \u00E9chantillon \: 
 view_results_sample_start=Date d\u00E9but \u00E9chantillon \: 
 view_results_search_pane=Volet recherche 
+view_results_sent_bytes=Octets envoy\u00E9s:
 view_results_size_body_in_bytes=Taille du corps en octets \: 
 view_results_size_headers_in_bytes=Taille de l'ent\u00EAte en octets \: 
 view_results_size_in_bytes=Taille en octets \: 

Modified: jmeter/trunk/src/core/org/apache/jmeter/samplers/SampleResult.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/samplers/SampleResult.java?rev=1763984&r1=1763983&r2=1763984&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/samplers/SampleResult.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/samplers/SampleResult.java Sun Oct  9 15:03:03
2016
@@ -267,7 +267,9 @@ public class SampleResult implements Ser
      * Cache for responseData as string to avoid multiple computations
      */
     private volatile transient String responseDataAsString;
-    
+
+    private long sentBytes;
+
     private long initOffset(){
         if (useNanoTime){
             return nanoThreadSleep > 0 ? NanoOffset.getNanoOffset() : System.currentTimeMillis()
- sampleNsClockInMs();
@@ -329,6 +331,7 @@ public class SampleResult implements Ser
         sampleCount = res.sampleCount;
         samplerData = res.samplerData;
         saveConfig = res.saveConfig;
+        sentBytes = res.sentBytes;
         startTime = res.startTime;//OK
         stopTest = res.stopTest;
         stopTestNow = res.stopTestNow;
@@ -611,6 +614,7 @@ public class SampleResult implements Ser
         setEndTime(Math.max(getEndTime(), subResult.getEndTime() + nanoTimeOffset - subResult.nanoTimeOffset));
// Bug 51855
         // Include the byte count for the added sample
         setBytes(getBytes() + subResult.getBytes());
+        setSentBytes(getSentBytes() + subResult.getSentBytes());
         setHeadersSize(getHeadersSize() + subResult.getHeadersSize());
         setBodySize(getBodySize() + subResult.getBodySize());
         addRawSubResult(subResult);
@@ -1195,6 +1199,21 @@ public class SampleResult implements Ser
     }
 
     /**
+     * 
+     * @param sentBytesCount long sent bytes
+     */
+    public void setSentBytes(long sentBytesCount) {
+        sentBytes = sentBytesCount;
+    }
+
+    /**
+     * @return the sentBytes
+     */
+    public long getSentBytes() {
+        return sentBytes;
+    }
+    
+    /**
      * return the bytes returned by the response.
      *
      * @return byte count

Modified: jmeter/trunk/src/core/org/apache/jmeter/samplers/SampleSaveConfiguration.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/samplers/SampleSaveConfiguration.java?rev=1763984&r1=1763983&r2=1763984&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/samplers/SampleSaveConfiguration.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/samplers/SampleSaveConfiguration.java Sun Oct
 9 15:03:03 2016
@@ -180,6 +180,9 @@ public class SampleSaveConfiguration imp
 
     // Save bytes read
     private static final String SAVE_BYTES_PROP = "jmeter.save.saveservice.bytes"; // $NON_NLS-1$
+    
+    // Save bytes written
+    private static final String SAVE_SENT_BYTES_PROP = "jmeter.save.saveservice.sent_bytes";
// $NON_NLS-1$
 
     // Save URL
     private static final String SAVE_URL_PROP = "jmeter.save.saveservice.url"; // $NON_NLS-1$
@@ -230,7 +233,7 @@ public class SampleSaveConfiguration imp
 
     private boolean saveAssertionResultsFailureMessage = _saveAssertionResultsFailureMessage;
 
-    private boolean url = _url, bytes = _bytes , fileName = _fileName;
+    private boolean url = _url, bytes = _bytes , sentBytes = _sentBytes, fileName = _fileName;
 
     private boolean hostname = _hostname;
 
@@ -277,6 +280,8 @@ public class SampleSaveConfiguration imp
     private static final boolean _printMilliseconds;
 
     private static final boolean _bytes;
+    
+    private static final boolean _sentBytes;
 
     private static final boolean _url;
 
@@ -347,6 +352,8 @@ public class SampleSaveConfiguration imp
         _threadName = TRUE.equalsIgnoreCase(props.getProperty(SAVE_THREAD_NAME_PROP, TRUE));
 
         _bytes = TRUE.equalsIgnoreCase(props.getProperty(SAVE_BYTES_PROP, TRUE));
+        
+        _sentBytes = TRUE.equalsIgnoreCase(props.getProperty(SAVE_SENT_BYTES_PROP, TRUE));
 
         _url = TRUE.equalsIgnoreCase(props.getProperty(SAVE_URL_PROP, FALSE));
 
@@ -468,6 +475,7 @@ public class SampleSaveConfiguration imp
         "Success",
         "AssertionResultsFailureMessage",
         "Bytes",
+        "SentBytes",
         "ThreadCounts", // grpThreads and allThreads
         "Url",
         "FileName",
@@ -515,6 +523,7 @@ public class SampleSaveConfiguration imp
         sampleCount = value;
         samplerData = value;
         saveAssertionResultsFailureMessage = value;
+        sentBytes = value;
         subresults = value;
         success = value;
         threadCounts = value;
@@ -579,6 +588,7 @@ public class SampleSaveConfiguration imp
             s.responseDataOnError == responseDataOnError &&
             s.url == url &&
             s.bytes == bytes &&
+            s.sentBytes == sentBytes &&
             s.fileName == fileName &&
             s.hostname == hostname &&
             s.sampleCount == sampleCount &&
@@ -625,6 +635,7 @@ public class SampleSaveConfiguration imp
         hash = 31 * hash + (responseDataOnError ? 1 : 0);
         hash = 31 * hash + (url ? 1 : 0);
         hash = 31 * hash + (bytes ? 1 : 0);
+        hash = 31 * hash + (sentBytes ? 1 : 0);
         hash = 31 * hash + (fileName ? 1 : 0);
         hash = 31 * hash + (hostname ? 1 : 0);
         hash = 31 * hash + (threadCounts ? 1 : 0);
@@ -816,6 +827,14 @@ public class SampleSaveConfiguration imp
     public void setBytes(boolean save) {
         this.bytes = save;
     }
+    
+    public boolean saveSentBytes() {
+        return sentBytes;
+    }
+
+    public void setSentBytes(boolean save) {
+        this.sentBytes = save;
+    }
 
     public boolean saveFileName() {
         return fileName;

Modified: jmeter/trunk/src/core/org/apache/jmeter/samplers/StatisticalSampleResult.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/samplers/StatisticalSampleResult.java?rev=1763984&r1=1763983&r2=1763984&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/samplers/StatisticalSampleResult.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/samplers/StatisticalSampleResult.java Sun Oct
 9 15:03:03 2016
@@ -73,6 +73,7 @@ public class StatisticalSampleResult ext
         setSampleCount(getSampleCount() + res.getSampleCount());
 
         setBytes(getBytes() + res.getBytes());
+        setSentBytes(getSentBytes() + res.getSentBytes());
 
         // Add Error Counter
         if (!res.isSuccessful()) {

Modified: jmeter/trunk/src/core/org/apache/jmeter/save/CSVSaveService.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/save/CSVSaveService.java?rev=1763984&r1=1763983&r2=1763984&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/save/CSVSaveService.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/save/CSVSaveService.java Sun Oct  9 15:03:03 2016
@@ -81,6 +81,7 @@ public final class CSVSaveService {
 
     public static final String CSV_ELAPSED = "elapsed"; // $NON-NLS-1$
     public static final String CSV_BYTES = "bytes"; // $NON-NLS-1$
+    public static final String CSV_SENT_BYTES = "sentBytes"; // $NON-NLS-1$
     public static final String CSV_THREAD_COUNT1 = "grpThreads"; // $NON-NLS-1$
     public static final String CSV_THREAD_COUNT2 = "allThreads"; // $NON-NLS-1$
     public static final String CSV_SAMPLE_COUNT = "SampleCount"; // $NON-NLS-1$
@@ -300,6 +301,12 @@ public final class CSVSaveService {
                 text = parts[i++];
                 result.setBytes(Integer.parseInt(text));
             }
+            
+            if (saveConfig.saveSentBytes()) {
+                field = CSV_SENT_BYTES;
+                text = parts[i++];
+                result.setSentBytes(Long.parseLong(text));
+            }
 
             if (saveConfig.saveThreadCounts()) {
                 field = CSV_THREAD_COUNT1;
@@ -446,6 +453,11 @@ public final class CSVSaveService {
             text.append(CSV_BYTES);
             text.append(delim);
         }
+        
+        if (saveConfig.saveSentBytes()) {
+            text.append(CSV_SENT_BYTES);
+            text.append(delim);
+        }
 
         if (saveConfig.saveThreadCounts()) {
             text.append(CSV_THREAD_COUNT1);
@@ -533,6 +545,7 @@ public final class CSVSaveService {
         headerLabelMethods.put(FAILURE_MESSAGE, new Functor(
                 "setAssertionResultsFailureMessage"));
         headerLabelMethods.put(CSV_BYTES, new Functor("setBytes"));
+        headerLabelMethods.put(CSV_SENT_BYTES, new Functor("setSentBytes"));
         // Both these are needed in the list even though they set the same
         // variable
         headerLabelMethods.put(CSV_THREAD_COUNT1,
@@ -925,6 +938,10 @@ public final class CSVSaveService {
         if (saveConfig.saveBytes()) {
             text.append(sample.getBytes());
         }
+        
+        if (saveConfig.saveSentBytes()) {
+            text.append(sample.getSentBytes());
+        }
 
         if (saveConfig.saveThreadCounts()) {
             text.append(sample.getGroupThreads());

Modified: jmeter/trunk/src/core/org/apache/jmeter/save/converters/SampleResultConverter.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/save/converters/SampleResultConverter.java?rev=1763984&r1=1763983&r2=1763984&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/save/converters/SampleResultConverter.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/save/converters/SampleResultConverter.java Sun
Oct  9 15:03:03 2016
@@ -68,6 +68,7 @@ public class SampleResultConverter exten
     // samplerData attributes. Must be unique. Keep sorted by string value.
     // Ensure the Listener documentation is updated when new attributes are added
     private static final String ATT_BYTES             = "by"; //$NON-NLS-1$
+    private static final String ATT_SENT_BYTES        = "sby"; //$NON-NLS-1$
     private static final String ATT_DATA_ENCODING     = "de"; //$NON-NLS-1$
     private static final String ATT_DATA_TYPE         = "dt"; //$NON-NLS-1$
     private static final String ATT_ERROR_COUNT       = "ec"; //$NON-NLS-1$
@@ -321,6 +322,9 @@ public class SampleResultConverter exten
         if (save.saveBytes()) {
             writer.addAttribute(ATT_BYTES, String.valueOf(res.getBytes()));
         }
+        if (save.saveSentBytes()) {
+            writer.addAttribute(ATT_SENT_BYTES, String.valueOf(res.getSentBytes()));
+        }
         if (save.saveSampleCount()){
             writer.addAttribute(ATT_SAMPLE_COUNT, String.valueOf(res.getSampleCount()));
             writer.addAttribute(ATT_ERROR_COUNT, String.valueOf(res.getErrorCount()));
@@ -446,6 +450,7 @@ public class SampleResultConverter exten
         res.setLatency(Converter.getLong(reader.getAttribute(ATT_LATENCY)));
         res.setConnectTime(Converter.getLong(reader.getAttribute(ATT_CONNECT_TIME)));
         res.setBytes(Converter.getInt(reader.getAttribute(ATT_BYTES)));
+        res.setSentBytes(Converter.getLong(reader.getAttribute(ATT_SENT_BYTES)));
         res.setSampleCount(Converter.getInt(reader.getAttribute(ATT_SAMPLE_COUNT),1)); //
default is 1
         res.setErrorCount(Converter.getInt(reader.getAttribute(ATT_ERROR_COUNT),0)); // default
is 0
         res.setGroupThreads(Converter.getInt(reader.getAttribute(ATT_GRP_THRDS)));

Modified: jmeter/trunk/src/core/org/apache/jmeter/save/converters/SampleSaveConfigurationConverter.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/save/converters/SampleSaveConfigurationConverter.java?rev=1763984&r1=1763983&r2=1763984&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/save/converters/SampleSaveConfigurationConverter.java
(original)
+++ jmeter/trunk/src/core/org/apache/jmeter/save/converters/SampleSaveConfigurationConverter.java
Sun Oct  9 15:03:03 2016
@@ -58,6 +58,7 @@ public class SampleSaveConfigurationConv
     private static final String NODE_HOSTNAME = "hostname"; // $NON-NLS-1$
     private static final String NODE_URL = "url"; // $NON-NLS-1$
     private static final String NODE_BYTES = "bytes"; // $NON-NLS-1$
+    private static final String NODE_SENT_BYTES = "sentBytes"; // $NON-NLS-1$
     private static final String NODE_THREAD_COUNT = "threadCounts"; // $NON-NLS-1$
     private static final String NODE_SAMPLE_COUNT = "sampleCount"; // $NON-NLS-1$
     private static final String NODE_IDLE_TIME = "idleTime"; // $NON-NLS-1$
@@ -84,6 +85,7 @@ public class SampleSaveConfigurationConv
             // These are new fields; not saved unless true
             // This list MUST agree with the list in the marshall() method below
             if (fieldName.equals(NODE_BYTES)) { return false; }
+            if (fieldName.equals(NODE_SENT_BYTES)) { return false; }
             if (fieldName.equals(NODE_URL)) { return false; }
             if (fieldName.equals(NODE_FILENAME)) { return false; }
             if (fieldName.equals(NODE_HOSTNAME)) { return false; }
@@ -129,6 +131,7 @@ public class SampleSaveConfigurationConv
         // Save the new fields - but only if they are true
         // This list MUST agree with the list in MyWrapper#shouldSerializeMember()
         createNode(writer,prop.saveBytes(),NODE_BYTES);
+        createNode(writer,prop.saveSentBytes(),NODE_SENT_BYTES);
         createNode(writer,prop.saveUrl(),NODE_URL);
         createNode(writer,prop.saveFileName(),NODE_FILENAME);
         createNode(writer,prop.saveHostname(),NODE_HOSTNAME);

Modified: jmeter/trunk/src/core/org/apache/jmeter/visualizers/TableSample.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/visualizers/TableSample.java?rev=1763984&r1=1763983&r2=1763984&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/visualizers/TableSample.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/visualizers/TableSample.java Sun Oct  9 15:03:03
2016
@@ -43,6 +43,8 @@ public class TableSample implements Seri
     private final boolean success;
 
     private final long bytes;
+    
+    private final long sentBytes;
 
     private final long latency;
 
@@ -53,12 +55,12 @@ public class TableSample implements Seri
      */
     @Deprecated
     public TableSample() {
-        this(0, 1, 0, "", "", 0, true, 0, 0, 0);
+        this(0, 1, 0, "", "", 0, true, 0, 0, 0, 0);
     }
 
     public TableSample(long totalSamples, int sampleCount, long startTime, String threadName,
             String label,
-            long elapsed, boolean success, long bytes, long latency, long connect) {
+            long elapsed, boolean success, long bytes, long sentBytes, long latency, long
connect) {
         this.totalSamples = totalSamples;
         this.sampleCount = sampleCount;
         this.startTime = startTime;
@@ -67,6 +69,7 @@ public class TableSample implements Seri
         // SampleCount can be equal to 0, see SubscriberSampler#sample
         this.elapsed = (sampleCount > 0) ? elapsed/sampleCount : 0;
         this.bytes =  (sampleCount > 0) ? bytes/sampleCount : 0;
+        this.sentBytes = (sampleCount > 0) ? sentBytes/sampleCount : 0;
         this.success = success;
         this.latency = latency;
         this.connect = connect;
@@ -151,4 +154,11 @@ public class TableSample implements Seri
     public long getConnectTime() {
         return connect;
     }
+
+    /**
+     * @return the sentBytes
+     */
+    public long getSentBytes() {
+        return sentBytes;
+    }
 }

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java?rev=1763984&r1=1763983&r2=1763984&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java
(original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java
Sun Oct  9 15:03:03 2016
@@ -439,6 +439,7 @@ public class HTTPHC4Impl extends HTTPHCA
             long totalBytes = metrics.getReceivedBytesCount();
             res.setHeadersSize((int) headerBytes);
             res.setBodySize((int)(totalBytes - headerBytes));
+            res.setSentBytes(metrics.getSentBytesCount());
             if (log.isDebugEnabled()) {
                 log.debug("ResponseHeadersSize=" + res.getHeadersSize() + " Content-Length="
+ res.getBodySize()
                         + " Total=" + (res.getHeadersSize() + res.getBodySize()));

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1763984&r1=1763983&r2=1763984&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml [utf-8] (original)
+++ jmeter/trunk/xdocs/changes.xml [utf-8] Sun Oct  9 15:03:03 2016
@@ -93,6 +93,7 @@ Summary
     <li><bug>59882</bug>Reduce memory allocations for better throughput.
Contributed by Benoit Wiart (b.wiart at ubik-ingenierie.com) through <pr>217</pr>
and <pr>228</pr></li>
     <li><bug>59885</bug>Optimize css parsing for embedded resources download
by introducing a cache. Contributed by Benoit Wiart (b.wiart at ubik-ingenierie.com) through
<pr>219</pr></li>
     <li><bug>60092</bug>Add shortened version of the PUT body to sampler
result.</li>
+    <li><bug>60229</bug>Add a new metric : sent_bytes. Implemented by Philippe
Mouawad (p.mouawad at ubik-ingenierie.com) and contributed by Ubik Load Pack (support at ubikloadpack.com)</li>
 </ul>
 
 <h3>Other samplers</h3>

Modified: jmeter/trunk/xdocs/usermanual/listeners.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/usermanual/listeners.xml?rev=1763984&r1=1763983&r2=1763984&view=diff
==============================================================================
--- jmeter/trunk/xdocs/usermanual/listeners.xml (original)
+++ jmeter/trunk/xdocs/usermanual/listeners.xml Sun Oct  9 15:03:03 2016
@@ -141,6 +141,7 @@ The full set of properties that affect r
 #jmeter.save.saveservice.requestHeaders=false
 #jmeter.save.saveservice.encoding=false
 #jmeter.save.saveservice.bytes=true
+#jmeter.save.saveservice.sent_bytes=true
 #jmeter.save.saveservice.url=false
 #jmeter.save.saveservice.filename=false
 #jmeter.save.saveservice.hostname=false
@@ -302,6 +303,7 @@ The order of appearance of columns is fi
 <li><code>success</code> - <code>true</code> or <code>false</code></li>
 <li><code>failureMessage</code> - if any</li>
 <li><code>bytes</code> - number of bytes in the sample</li>
+<li><code>sentBytes</code> - number of bytes sent for the sample</li>
 <li><code>grpThreads</code> - number of active threads in this thread group</li>
 <li><code>allThreads</code> - total number of active threads in all groups</li>
 <li><code>URL</code></li>
@@ -424,6 +426,7 @@ The sample attributes have the following
 <table>
 <tr><th>Attribute</th><th>Content</th></tr>
 <tr><td><code>by</code></td><td>Bytes</td></tr>
+<tr><td><code>sby</code></td><td>Sent Bytes</td></tr>
 <tr><td><code>de</code></td><td>Data encoding</td></tr>
 <tr><td><code>dt</code></td><td>Data type</td></tr>
 <tr><td><code>ec</code></td><td>Error count (0 or 1,
unless multiple samples are aggregated)</td></tr>



Mime
View raw message