jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1717681 - in /jmeter/trunk: src/components/org/apache/jmeter/visualizers/backend/graphite/GraphiteBackendListenerClient.java xdocs/changes.xml
Date Wed, 02 Dec 2015 20:48:51 GMT
Author: pmouawad
Date: Wed Dec  2 20:48:51 2015
New Revision: 1717681

URL: http://svn.apache.org/viewvc?rev=1717681&view=rev
Log:
Bug 58681 - GraphiteBackendListener : Don't send data if no sampling occured
#resolve #26
Remove useless test of metric.getTotal()
Bugzilla Id: 58681

Modified:
    jmeter/trunk/src/components/org/apache/jmeter/visualizers/backend/graphite/GraphiteBackendListenerClient.java
    jmeter/trunk/xdocs/changes.xml

Modified: jmeter/trunk/src/components/org/apache/jmeter/visualizers/backend/graphite/GraphiteBackendListenerClient.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/visualizers/backend/graphite/GraphiteBackendListenerClient.java?rev=1717681&r1=1717680&r2=1717681&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/visualizers/backend/graphite/GraphiteBackendListenerClient.java
(original)
+++ jmeter/trunk/src/components/org/apache/jmeter/visualizers/backend/graphite/GraphiteBackendListenerClient.java
Wed Dec  2 20:48:51 2015
@@ -154,13 +154,13 @@ public class GraphiteBackendListenerClie
      * @param metric {@link SamplerMetric}
      */
     private void addMetrics(long timestampInSeconds, String contextName, SamplerMetric metric)
{
-        graphiteMetricsManager.addMetric(timestampInSeconds, contextName, METRIC_OK_COUNT,
Integer.toString(metric.getSuccesses()));
-        graphiteMetricsManager.addMetric(timestampInSeconds, contextName, METRIC_KO_COUNT,
Integer.toString(metric.getFailures()));
-        graphiteMetricsManager.addMetric(timestampInSeconds, contextName, METRIC_ALL_COUNT,
Integer.toString(metric.getTotal()));
-        graphiteMetricsManager.addMetric(timestampInSeconds, contextName, METRIC_ALL_HITS_COUNT,
Integer.toString(metric.getHits()));
 
         // See https://bz.apache.org/bugzilla/show_bug.cgi?id=57350
         if(metric.getTotal() > 0) { 
+            graphiteMetricsManager.addMetric(timestampInSeconds, contextName, METRIC_OK_COUNT,
Integer.toString(metric.getSuccesses()));
+            graphiteMetricsManager.addMetric(timestampInSeconds, contextName, METRIC_KO_COUNT,
Integer.toString(metric.getFailures()));
+            graphiteMetricsManager.addMetric(timestampInSeconds, contextName, METRIC_ALL_COUNT,
Integer.toString(metric.getTotal()));
+            graphiteMetricsManager.addMetric(timestampInSeconds, contextName, METRIC_ALL_HITS_COUNT,
Integer.toString(metric.getHits()));
             if(metric.getSuccesses()>0) {
                 graphiteMetricsManager.addMetric(timestampInSeconds, contextName, METRIC_OK_MIN_RESPONSE_TIME,
Double.toString(metric.getOkMinTime()));
                 graphiteMetricsManager.addMetric(timestampInSeconds, contextName, METRIC_OK_MAX_RESPONSE_TIME,
Double.toString(metric.getOkMaxTime()));
@@ -179,15 +179,12 @@ public class GraphiteBackendListenerClie
                             Double.toString(metric.getKoPercentile(entry.getValue().floatValue())));
           
                 }   
             }
-            if(metric.getTotal()>0) {
-                graphiteMetricsManager.addMetric(timestampInSeconds, contextName, METRIC_ALL_MIN_RESPONSE_TIME,
Double.toString(metric.getAllMinTime()));
-                graphiteMetricsManager.addMetric(timestampInSeconds, contextName, METRIC_ALL_MAX_RESPONSE_TIME,
Double.toString(metric.getAllMaxTime()));
-                for (Map.Entry<String, Float> entry : allPercentiles.entrySet()) {
-                    graphiteMetricsManager.addMetric(timestampInSeconds, contextName, 
-                            entry.getKey(), 
-                            Double.toString(metric.getAllPercentile(entry.getValue().floatValue())));
           
-                }   
-                
+            graphiteMetricsManager.addMetric(timestampInSeconds, contextName, METRIC_ALL_MIN_RESPONSE_TIME,
Double.toString(metric.getAllMinTime()));
+            graphiteMetricsManager.addMetric(timestampInSeconds, contextName, METRIC_ALL_MAX_RESPONSE_TIME,
Double.toString(metric.getAllMaxTime()));
+            for (Map.Entry<String, Float> entry : allPercentiles.entrySet()) {
+                graphiteMetricsManager.addMetric(timestampInSeconds, contextName, 
+                        entry.getKey(), 
+                        Double.toString(metric.getAllPercentile(entry.getValue().floatValue())));
             }
         }
     }

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1717681&r1=1717680&r2=1717681&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml (original)
+++ jmeter/trunk/xdocs/changes.xml Wed Dec  2 20:48:51 2015
@@ -111,6 +111,7 @@ Summary
 <ul>
 <li><bug>58041</bug>Tree View Listener should show sample data type</li>
 <li><bug>58122</bug>GraphiteBackendListener : Add Server Hits metric. Partly
based on a patch from Amol Moye (amol.moye at thomsonreuters.com)</li>
+<li><bug>58681</bug>GraphiteBackendListener : Don't send data if no sampling
occured</li>
 </ul>
 
 <h3>Timers, Assertions, Config, Pre- &amp; Post-Processors</h3>



Mime
View raw message