Bug 59953 - GraphiteBackendListener : Add Average metric

Bugzilla Id: 59953

git-svn-id: https://svn.apache.org/repos/asf/jmeter/trunk@1755398 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Philippe Mouawad 2016-08-06 13:53:04 +00:00
parent 458ca49ae6
commit d48d25185d
3 changed files with 15 additions and 0 deletions

View File

@ -85,21 +85,25 @@ public class GraphiteBackendListenerClient extends AbstractBackendListenerClient
private static final String METRIC_COUNT = "count"; //$NON-NLS-1$
private static final String METRIC_MIN_RESPONSE_TIME = "min"; //$NON-NLS-1$
private static final String METRIC_MAX_RESPONSE_TIME = "max"; //$NON-NLS-1$
private static final String METRIC_AVG_RESPONSE_TIME = "avg"; //$NON-NLS-1$
private static final String METRIC_PERCENTILE = "pct"; //$NON-NLS-1$
private static final String METRIC_OK_COUNT = METRIC_OK_PREFIX+METRIC_SEPARATOR+METRIC_COUNT;
private static final String METRIC_OK_MIN_RESPONSE_TIME = METRIC_OK_PREFIX+METRIC_SEPARATOR+METRIC_MIN_RESPONSE_TIME;
private static final String METRIC_OK_MAX_RESPONSE_TIME = METRIC_OK_PREFIX+METRIC_SEPARATOR+METRIC_MAX_RESPONSE_TIME;
private static final String METRIC_OK_AVG_RESPONSE_TIME = METRIC_OK_PREFIX+METRIC_SEPARATOR+METRIC_AVG_RESPONSE_TIME;
private static final String METRIC_OK_PERCENTILE_PREFIX = METRIC_OK_PREFIX+METRIC_SEPARATOR+METRIC_PERCENTILE;
private static final String METRIC_KO_COUNT = METRIC_KO_PREFIX+METRIC_SEPARATOR+METRIC_COUNT;
private static final String METRIC_KO_MIN_RESPONSE_TIME = METRIC_KO_PREFIX+METRIC_SEPARATOR+METRIC_MIN_RESPONSE_TIME;
private static final String METRIC_KO_MAX_RESPONSE_TIME = METRIC_KO_PREFIX+METRIC_SEPARATOR+METRIC_MAX_RESPONSE_TIME;
private static final String METRIC_KO_AVG_RESPONSE_TIME = METRIC_KO_PREFIX+METRIC_SEPARATOR+METRIC_AVG_RESPONSE_TIME;
private static final String METRIC_KO_PERCENTILE_PREFIX = METRIC_KO_PREFIX+METRIC_SEPARATOR+METRIC_PERCENTILE;
private static final String METRIC_ALL_COUNT = METRIC_ALL_PREFIX+METRIC_SEPARATOR+METRIC_COUNT;
private static final String METRIC_ALL_MIN_RESPONSE_TIME = METRIC_ALL_PREFIX+METRIC_SEPARATOR+METRIC_MIN_RESPONSE_TIME;
private static final String METRIC_ALL_MAX_RESPONSE_TIME = METRIC_ALL_PREFIX+METRIC_SEPARATOR+METRIC_MAX_RESPONSE_TIME;
private static final String METRIC_ALL_AVG_RESPONSE_TIME = METRIC_ALL_PREFIX+METRIC_SEPARATOR+METRIC_AVG_RESPONSE_TIME;
private static final String METRIC_ALL_PERCENTILE_PREFIX = METRIC_ALL_PREFIX+METRIC_SEPARATOR+METRIC_PERCENTILE;
private static final String METRIC_ALL_HITS_COUNT = METRIC_HITS_PREFIX+METRIC_SEPARATOR+METRIC_COUNT;
@ -185,6 +189,7 @@ public class GraphiteBackendListenerClient extends AbstractBackendListenerClient
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()));
graphiteMetricsManager.addMetric(timestampInSeconds, contextName, METRIC_OK_AVG_RESPONSE_TIME, Double.toString(metric.getOkMean()));
for (Map.Entry<String, Float> entry : okPercentiles.entrySet()) {
graphiteMetricsManager.addMetric(timestampInSeconds, contextName,
entry.getKey(),
@ -194,6 +199,7 @@ public class GraphiteBackendListenerClient extends AbstractBackendListenerClient
if(metric.getFailures()>0) {
graphiteMetricsManager.addMetric(timestampInSeconds, contextName, METRIC_KO_MIN_RESPONSE_TIME, Double.toString(metric.getKoMinTime()));
graphiteMetricsManager.addMetric(timestampInSeconds, contextName, METRIC_KO_MAX_RESPONSE_TIME, Double.toString(metric.getKoMaxTime()));
graphiteMetricsManager.addMetric(timestampInSeconds, contextName, METRIC_KO_AVG_RESPONSE_TIME, Double.toString(metric.getKoMean()));
for (Map.Entry<String, Float> entry : koPercentiles.entrySet()) {
graphiteMetricsManager.addMetric(timestampInSeconds, contextName,
entry.getKey(),
@ -202,6 +208,7 @@ public class GraphiteBackendListenerClient extends AbstractBackendListenerClient
}
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()));
graphiteMetricsManager.addMetric(timestampInSeconds, contextName, METRIC_ALL_AVG_RESPONSE_TIME, Double.toString(metric.getAllMean()));
for (Map.Entry<String, Float> entry : allPercentiles.entrySet()) {
graphiteMetricsManager.addMetric(timestampInSeconds, contextName,
entry.getKey(),

View File

@ -96,6 +96,7 @@ Summary
<h3>Listeners</h3>
<ul>
<li><bug>59953</bug>GraphiteBackendListener : Add Average metric. Partly contributed by Maxime Chassagneux (maxime.chassagneux at gmail.com)</li>
</ul>
<h3>Timers, Assertions, Config, Pre- &amp; Post-Processors</h3>
@ -200,6 +201,7 @@ Summary
<li>Asier Lostalé (asier.lostale at openbravo.com)</li>
<li>Thomas Peyrard (thomas.peyrard at murex.com)</li>
<li>Benoit Wiart (b.wiart at ubik-ingenierie.com)</li>
<li>Maxime Chassagneux (maxime.chassagneux at gmail.com)</li>
</ul>
<p>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:</p>

View File

@ -73,6 +73,8 @@ In this document we will present the configuration setup to graph and historize
<dd>Min response time for successful responses of sampler name</dd>
<dt><code>&lt;rootMetricsPrefix&gt;&lt;samplerName&gt;.ok.max</code></dt>
<dd>Max response time for successful responses of sampler name</dd>
<dt><code>&lt;rootMetricsPrefix&gt;&lt;samplerName&gt;.ok.avg</code></dt>
<dd>Average response time for successful responses of sampler name.</dd>
<dt><code>&lt;rootMetricsPrefix&gt;&lt;samplerName&gt;.ok.pct&lt;percentileValue&gt;</code></dt>
<dd>Percentile computed for successful responses of sampler name. There will be one metric for each calculated value.</dd>
<dt><code>&lt;rootMetricsPrefix&gt;&lt;samplerName&gt;.ko.count</code></dt>
@ -81,6 +83,8 @@ In this document we will present the configuration setup to graph and historize
<dd>Min response time for failed responses of sampler name</dd>
<dt><code>&lt;rootMetricsPrefix&gt;&lt;samplerName&gt;.ko.max</code></dt>
<dd>Max response time for failed responses of sampler name</dd>
<dt><code>&lt;rootMetricsPrefix&gt;&lt;samplerName&gt;.ko.avg</code></dt>
<dd>Average response time for failed responses of sampler name.</dd>
<dt><code>&lt;rootMetricsPrefix&gt;&lt;samplerName&gt;.ko.pct&lt;percentileValue&gt;</code></dt>
<dd>Percentile computed for failed responses of sampler name. There will be one metric for each calculated value.</dd>
<dt><code>&lt;rootMetricsPrefix&gt;&lt;samplerName&gt;.a.count</code></dt>
@ -89,6 +93,8 @@ In this document we will present the configuration setup to graph and historize
<dd>Min response time for responses of sampler name (min of ok.count and ko.count)</dd>
<dt><code>&lt;rootMetricsPrefix&gt;&lt;samplerName&gt;.a.max</code></dt>
<dd>Max response time for responses of sampler name (max of ok.count and ko.count)</dd>
<dt><code>&lt;rootMetricsPrefix&gt;&lt;samplerName&gt;.a.avg</code></dt>
<dd>Average response time for responses of sampler name (avg of ok.count and ko.count)</dd>
<dt><code>&lt;rootMetricsPrefix&gt;&lt;samplerName&gt;.a.pct&lt;percentileValue&gt;</code></dt>
<dd>Percentile computed for responses of sampler name. There will be one metric for each calculated value. (calculated on the totals for OK and failed samples)</dd>
</dl>