From d48d25185d70d95fd92b5f34c4a193ebc80c645c Mon Sep 17 00:00:00 2001 From: Philippe Mouawad Date: Sat, 6 Aug 2016 13:53:04 +0000 Subject: [PATCH] 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 --- .../backend/graphite/GraphiteBackendListenerClient.java | 7 +++++++ xdocs/changes.xml | 2 ++ xdocs/usermanual/realtime-results.xml | 6 ++++++ 3 files changed, 15 insertions(+) diff --git a/src/components/org/apache/jmeter/visualizers/backend/graphite/GraphiteBackendListenerClient.java b/src/components/org/apache/jmeter/visualizers/backend/graphite/GraphiteBackendListenerClient.java index 90781a43ab..f0dd3a8d52 100644 --- a/src/components/org/apache/jmeter/visualizers/backend/graphite/GraphiteBackendListenerClient.java +++ b/src/components/org/apache/jmeter/visualizers/backend/graphite/GraphiteBackendListenerClient.java @@ -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 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 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 entry : allPercentiles.entrySet()) { graphiteMetricsManager.addMetric(timestampInSeconds, contextName, entry.getKey(), diff --git a/xdocs/changes.xml b/xdocs/changes.xml index ca4a530f9f..bcaac6363c 100644 --- a/xdocs/changes.xml +++ b/xdocs/changes.xml @@ -96,6 +96,7 @@ Summary

Listeners

    +
  • 59953GraphiteBackendListener : Add Average metric. Partly contributed by Maxime Chassagneux (maxime.chassagneux at gmail.com)

Timers, Assertions, Config, Pre- & Post-Processors

@@ -200,6 +201,7 @@ Summary
  • Asier LostalĂ© (asier.lostale at openbravo.com)
  • Thomas Peyrard (thomas.peyrard at murex.com)
  • Benoit Wiart (b.wiart at ubik-ingenierie.com)
  • +
  • Maxime Chassagneux (maxime.chassagneux at gmail.com)
  • We also thank bug reporters who helped us improve JMeter.
    For this release we want to give special thanks to the following reporters for the clear reports and tests made after our fixes:

    diff --git a/xdocs/usermanual/realtime-results.xml b/xdocs/usermanual/realtime-results.xml index b4240c9294..b66019af36 100644 --- a/xdocs/usermanual/realtime-results.xml +++ b/xdocs/usermanual/realtime-results.xml @@ -73,6 +73,8 @@ In this document we will present the configuration setup to graph and historize
    Min response time for successful responses of sampler name
    <rootMetricsPrefix><samplerName>.ok.max
    Max response time for successful responses of sampler name
    +
    <rootMetricsPrefix><samplerName>.ok.avg
    +
    Average response time for successful responses of sampler name.
    <rootMetricsPrefix><samplerName>.ok.pct<percentileValue>
    Percentile computed for successful responses of sampler name. There will be one metric for each calculated value.
    <rootMetricsPrefix><samplerName>.ko.count
    @@ -81,6 +83,8 @@ In this document we will present the configuration setup to graph and historize
    Min response time for failed responses of sampler name
    <rootMetricsPrefix><samplerName>.ko.max
    Max response time for failed responses of sampler name
    +
    <rootMetricsPrefix><samplerName>.ko.avg
    +
    Average response time for failed responses of sampler name.
    <rootMetricsPrefix><samplerName>.ko.pct<percentileValue>
    Percentile computed for failed responses of sampler name. There will be one metric for each calculated value.
    <rootMetricsPrefix><samplerName>.a.count
    @@ -89,6 +93,8 @@ In this document we will present the configuration setup to graph and historize
    Min response time for responses of sampler name (min of ok.count and ko.count)
    <rootMetricsPrefix><samplerName>.a.max
    Max response time for responses of sampler name (max of ok.count and ko.count)
    +
    <rootMetricsPrefix><samplerName>.a.avg
    +
    Average response time for responses of sampler name (avg of ok.count and ko.count)
    <rootMetricsPrefix><samplerName>.a.pct<percentileValue>
    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)