jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1645701 - in /jmeter/trunk: src/components/org/apache/jmeter/visualizers/backend/graphite/GraphiteBackendListenerClient.java xdocs/changes.xml xdocs/usermanual/component_reference.xml
Date Mon, 15 Dec 2014 17:16:25 GMT
Author: pmouawad
Date: Mon Dec 15 17:16:24 2014
New Revision: 1645701

URL: http://svn.apache.org/r1645701
Log:
Bug 57350 - BackendListener reports stale response time (Nightly Build r1645532)
Bug 57351 - Graphite Backend uses wrong default port for PlainText protocol (Nightly Build
r1645532)


Bugzilla Id: 57350

Modified:
    jmeter/trunk/src/components/org/apache/jmeter/visualizers/backend/graphite/GraphiteBackendListenerClient.java
    jmeter/trunk/xdocs/changes.xml
    jmeter/trunk/xdocs/usermanual/component_reference.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=1645701&r1=1645700&r2=1645701&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
Mon Dec 15 17:16:24 2014
@@ -44,7 +44,7 @@ import org.apache.log.Logger;
  * @since 2.13
  */
 public class GraphiteBackendListenerClient extends AbstractBackendListenerClient implements
Runnable {
-    private static final int DEFAULT_PICKLE_PORT = 2004;
+    private static final int DEFAULT_PLAINTEXT_PROTOCOL_PORT = 2003;
     private static final String CUMULATED_CONTEXT_NAME = "cumulated";
 
     private static final Logger LOGGER = LoggingManager.getLoggerForClass();
@@ -76,7 +76,7 @@ public class GraphiteBackendListenerClie
     private Map<String, Float> percentiles;
     
 
-    private GraphiteMetricsSender pickleMetricsManager;
+    private GraphiteMetricsSender graphiteMetricsManager;
 
     private ScheduledExecutorService scheduler;
     private ScheduledFuture<?> timerHandle;
@@ -108,31 +108,36 @@ public class GraphiteBackendListenerClie
                 metric.resetForTimeInterval();
             }
         }        
-        pickleMetricsManager.addMetric(timestampInSeconds, CUMULATED_CONTEXT_NAME, METRIC_MIN_ACTIVE_THREADS,
Integer.toString(getUserMetrics().getMaxActiveThreads()));
-        pickleMetricsManager.addMetric(timestampInSeconds, CUMULATED_CONTEXT_NAME, METRIC_MAX_ACTIVE_THREADS,
Integer.toString(getUserMetrics().getMinActiveThreads()));
-        pickleMetricsManager.addMetric(timestampInSeconds, CUMULATED_CONTEXT_NAME, METRIC_MEAN_ACTIVE_THREADS,
Integer.toString(getUserMetrics().getMeanActiveThreads()));
-        pickleMetricsManager.addMetric(timestampInSeconds, CUMULATED_CONTEXT_NAME, METRIC_STARTED_THREADS,
Integer.toString(getUserMetrics().getStartedThreads()));
-        pickleMetricsManager.addMetric(timestampInSeconds, CUMULATED_CONTEXT_NAME, METRIC_STOPPED_THREADS,
Integer.toString(getUserMetrics().getFinishedThreads()));
+        graphiteMetricsManager.addMetric(timestampInSeconds, CUMULATED_CONTEXT_NAME, METRIC_MIN_ACTIVE_THREADS,
Integer.toString(getUserMetrics().getMaxActiveThreads()));
+        graphiteMetricsManager.addMetric(timestampInSeconds, CUMULATED_CONTEXT_NAME, METRIC_MAX_ACTIVE_THREADS,
Integer.toString(getUserMetrics().getMinActiveThreads()));
+        graphiteMetricsManager.addMetric(timestampInSeconds, CUMULATED_CONTEXT_NAME, METRIC_MEAN_ACTIVE_THREADS,
Integer.toString(getUserMetrics().getMeanActiveThreads()));
+        graphiteMetricsManager.addMetric(timestampInSeconds, CUMULATED_CONTEXT_NAME, METRIC_STARTED_THREADS,
Integer.toString(getUserMetrics().getStartedThreads()));
+        graphiteMetricsManager.addMetric(timestampInSeconds, CUMULATED_CONTEXT_NAME, METRIC_STOPPED_THREADS,
Integer.toString(getUserMetrics().getFinishedThreads()));
 
-        pickleMetricsManager.writeAndSendMetrics();
+        graphiteMetricsManager.writeAndSendMetrics();
     }
 
 
     /**
+     * Add request metrics to metrics manager.
+     * Note if total number of requests is 0, no response time metrics are sent.
      * @param timestampInSeconds long
      * @param contextName String
      * @param metric {@link SamplerMetric}
      */
     private void addMetrics(long timestampInSeconds, String contextName, SamplerMetric metric)
{
-        pickleMetricsManager.addMetric(timestampInSeconds, contextName, METRIC_FAILED_REQUESTS,
Integer.toString(metric.getFailures()));
-        pickleMetricsManager.addMetric(timestampInSeconds, contextName, METRIC_SUCCESSFUL_REQUESTS,
Integer.toString(metric.getSuccesses()));
-        pickleMetricsManager.addMetric(timestampInSeconds, contextName, METRIC_TOTAL_REQUESTS,
Integer.toString(metric.getTotal()));
-        pickleMetricsManager.addMetric(timestampInSeconds, contextName, METRIC_MIN_RESPONSE_TIME,
Double.toString(metric.getMinTime()));
-        pickleMetricsManager.addMetric(timestampInSeconds, contextName, METRIC_MAX_RESPONSE_TIME,
Double.toString(metric.getMaxTime()));
-        for (Map.Entry<String, Float> entry : percentiles.entrySet()) {
-            pickleMetricsManager.addMetric(timestampInSeconds, contextName, 
-                    entry.getKey(), 
-                    Double.toString(metric.getPercentile(entry.getValue().floatValue())));
           
+        graphiteMetricsManager.addMetric(timestampInSeconds, contextName, METRIC_FAILED_REQUESTS,
Integer.toString(metric.getFailures()));
+        graphiteMetricsManager.addMetric(timestampInSeconds, contextName, METRIC_SUCCESSFUL_REQUESTS,
Integer.toString(metric.getSuccesses()));
+        graphiteMetricsManager.addMetric(timestampInSeconds, contextName, METRIC_TOTAL_REQUESTS,
Integer.toString(metric.getTotal()));
+        // See https://issues.apache.org/bugzilla/show_bug.cgi?id=57350
+        if(metric.getTotal() > 0) { 
+            graphiteMetricsManager.addMetric(timestampInSeconds, contextName, METRIC_MIN_RESPONSE_TIME,
Double.toString(metric.getMinTime()));
+            graphiteMetricsManager.addMetric(timestampInSeconds, contextName, METRIC_MAX_RESPONSE_TIME,
Double.toString(metric.getMaxTime()));
+            for (Map.Entry<String, Float> entry : percentiles.entrySet()) {
+                graphiteMetricsManager.addMetric(timestampInSeconds, contextName, 
+                        entry.getKey(), 
+                        Double.toString(metric.getPercentile(entry.getValue().floatValue())));
           
+            }
         }
     }
 
@@ -171,7 +176,7 @@ public class GraphiteBackendListenerClie
         String graphiteMetricsSenderClass = context.getParameter("graphiteMetricsSender");
         
         graphiteHost = context.getParameter("graphiteHost");
-        graphitePort = context.getIntParameter("graphitePort", DEFAULT_PICKLE_PORT);
+        graphitePort = context.getIntParameter("graphitePort", DEFAULT_PLAINTEXT_PROTOCOL_PORT);
         summaryOnly = context.getBooleanParameter("summaryOnly", true);
         samplersList = context.getParameter("samplersList", "");
         rootMetricsPrefix = context.getParameter("rootMetricsPrefix", DEFAULT_METRICS_PREFIX);
@@ -192,8 +197,8 @@ public class GraphiteBackendListenerClie
             }
         }
         Class<?> clazz = Class.forName(graphiteMetricsSenderClass);
-        this.pickleMetricsManager = (GraphiteMetricsSender) clazz.newInstance();
-        pickleMetricsManager.setup(graphiteHost, graphitePort, rootMetricsPrefix);
+        this.graphiteMetricsManager = (GraphiteMetricsSender) clazz.newInstance();
+        graphiteMetricsManager.setup(graphiteHost, graphitePort, rootMetricsPrefix);
         String[] samplers = samplersList.split(SEPARATOR);
         samplersToFilter = new HashSet<String>();
         for (String samplerName : samplers) {
@@ -220,7 +225,7 @@ public class GraphiteBackendListenerClie
         sendMetrics();
         
         samplersToFilter.clear();
-        pickleMetricsManager.destroy();
+        graphiteMetricsManager.destroy();
         super.teardownTest(context);
     }
 
@@ -229,7 +234,7 @@ public class GraphiteBackendListenerClie
         Arguments arguments = new Arguments();
         arguments.addArgument("graphiteMetricsSender", TextGraphiteMetricsSender.class.getName());
         arguments.addArgument("graphiteHost", "");
-        arguments.addArgument("graphitePort", Integer.toString(DEFAULT_PICKLE_PORT));
+        arguments.addArgument("graphitePort", Integer.toString(DEFAULT_PLAINTEXT_PROTOCOL_PORT));
         arguments.addArgument("rootMetricsPrefix", DEFAULT_METRICS_PREFIX);
         arguments.addArgument("summaryOnly", "true");
         arguments.addArgument("samplersList", "");

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1645701&r1=1645700&r2=1645701&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml (original)
+++ jmeter/trunk/xdocs/changes.xml Mon Dec 15 17:16:24 2014
@@ -154,6 +154,8 @@ See  <bugzilla>56357</bugzilla> for deta
 <ul>
 <li><bug>57262</bug>Aggregate Report, Aggregate Graph and Summary Report
export : headers use keys instead of labels</li>
 <li><bug>57321</bug>BackendListener reports partial results in master-slave
configuration (nightly build r1642603)</li>
+<li><bug>57350</bug>BackendListener reports stale response time (Nightly
Build r1645532). Contributed by Ubik Load Pack (support at ubikloadpack.com)</li>
+<li><bug>57351</bug>Graphite Backend uses wrong default port for PlainText
protocol (Nightly Build r1645532) . Contributed by Ubik Load Pack (support at ubikloadpack.com)</li>
 </ul>
 
 <h3>Timers, Assertions, Config, Pre- &amp; Post-Processors</h3>
@@ -223,13 +225,14 @@ See  <bugzilla>56357</bugzilla> for deta
 <ch_section>Thanks</ch_section>
 <p>We thank all contributors mentioned in bug and improvement sections above:
 <ul>
+<li><a href="http://ubikloadpack.com">Ubik Load Pack</a></li>
 </ul>
 
 <br/>
 We also thank bug reporters who helped us improve JMeter. <br/>
 For this release we want to give special thanks to the following reporters for the clear
reports and tests made after our fixes:
 <ul>
-<li><a href="http://ubikloadpack.com">Ubik Load Pack</a></li>
+<li>Chaitanya Bhatt (bhatt.chaitanya@gmail.com) for his thorough testing of new BackendListener
and Graphite Client implementation.</li>
 </ul>
 
 Apologies if we have omitted anyone else.

Modified: jmeter/trunk/xdocs/usermanual/component_reference.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/usermanual/component_reference.xml?rev=1645701&r1=1645700&r2=1645701&view=diff
==============================================================================
--- jmeter/trunk/xdocs/usermanual/component_reference.xml (original)
+++ jmeter/trunk/xdocs/usermanual/component_reference.xml Mon Dec 15 17:16:24 2014
@@ -3408,9 +3408,9 @@ By default, a Graphite implementation is
 
     <properties>
         <property name="graphiteMetricsSender" required="Yes">org.apache.jmeter.visualizers.backend.graphite.TextGraphiteMetricsSender
or org.apache.jmeter.visualizers.backend.graphite.PickleGraphiteMetricsSender</property>
-        <property name="graphiteHost" required="Yes">Graphite or InfluxDB or CollectD
server port</property>
-        <property name="graphitePort" required="Yes">Graphite or InfluxDB or CollectD
server port, defaults to 2003. Note PickleGraphiteMetricsSender can only talk to Graphite
server.</property>
-        <property name="rootMetricsPrefix" required="Yes">Prefix of metrics sent to
backend. Defaults to ""jmeter."</property>
+        <property name="graphiteHost" required="Yes">Graphite or InfluxDB (with Graphite
plugin enabled) or CollectD (with Graphite plugin enabled) server port</property>
+        <property name="graphitePort" required="Yes">Graphite or InfluxDB (with Graphite
plugin enabled) or CollectD (with Graphite plugin enabled) server port, defaults to 2003.
Note PickleGraphiteMetricsSender (port 2004) can only talk to Graphite server.</property>
+        <property name="rootMetricsPrefix" required="Yes">Prefix of metrics sent to
backend. Defaults to "jmeter."</property>
         <property name="summaryOnly" required="Yes">Only send a summary with no detail.
Defaults to true.</property>
         <property name="samplersList" required="Yes">Semicolon separated list of samplers
for which you want to report metrics to backend.</property>
         <property name="percentiles" required="Yes">The percentiles you want to send
to backend. List must be semicolon separated.</property>



Mime
View raw message