realtime-results.html 18.1 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--
   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
   this work for additional information regarding copyright ownership.
   The ASF licenses this file to You under the Apache License, Version 2.0
   (the "License"); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
-->

<!-- start the processing -->
<html>
<head>
<link rel="stylesheet" type="text/css" href="../../docs/css/style.css"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="author" value="Apache JMeter developers">
<meta name="email" value="dev@jmeter.apache.org">

<title>Apache JMeter - User's Manual: Live Statistics</title>
<style>
  .code { font-weight: bold; }
</style>
</head>

<body bgcolor="#ffffff" text="#000000" link="#525D76">
<table border="0" cellspacing="0">
<tr>
<td align="left">
<a href="http://www.apache.org"><img style="margin: 0px 30px 0px 0px" title="Apache Software Foundation" width="261" height="106" src="../../docs/images/asf-logo.png" border="0"/></a>
</td>
<td align="right">
<a href="http://jmeter.apache.org/"><img width="259" height="88" src="../../docs/images/jmeter.png" alt="Apache JMeter" title="Apache JMeter" border="0"/></a>
</td>
</tr>
</table>
<table border="0" cellspacing="4">
<tr><td>
<hr noshade size="1"/>
</td></tr>
<tr>
<td align="left" valign="top">
<table>
<tr>
<td bgcolor="#525D76">
<div align="right"><a href="index.html"><font size=-1 color="#ffffff" face="arial,helvetica,sanserif">Index</font></a></div>
</td>
<td bgcolor="#525D76">
<div align="right"><a href="best-practices.html"><font size=-1 color="#ffffff" face="arial,helvetica,sanserif">Next</font></a></div>
</td>
<td bgcolor="#525D76">
<div align="right"><a href="generating-dashboard.html"><font size=-1 color="#ffffff" face="arial,helvetica,sanserif">Prev</font></a></div>
</td>
</tr>
</table>
<br>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#525D76">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="realtime-results"><strong>16. Real-time results</strong></a></font>
</td></tr>
<tr><td>
<blockquote>
<p>Since JMeter 2.13 you can get real-time results sent to a backend through the 
<a href="component_reference.html#Backend_Listener">Backend Listener</a> using potentially any backend (JDBC, JMS, Webservice, …)
by providing a class which implements <a href="../api/org/apache/jmeter/visualizers/backend/AbstractBackendListenerClient.html">AbstractBackendListenerClient</a>.<br>
JMeter ships with a GraphiteBackendListenerClient which allows you to send metrics to a Graphite Backend.<br>
This feature provides:
<ul>
<li>Live results</li>
<li>Nice graphs for metrics</li>
<li>Ability to compare 2 or more load tests</li>
<li>Storing monitoring data as long as JMeter results in the same backend</li>
<li></li>
</ul>
In this document we will present the configuration setup to graph and historize the data in 2 different backends:
<ul>
<li>InfluxDB</li>
<li>Graphite</li>
</ul>
</p><table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="metrics"><strong>16.1 Metrics exposed</strong></a>
</font>
</td></tr>
<tr><td>
<blockquote>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="metrics-threads"><strong>16.1.1 Thread/Virtual Users metrics</strong></a>
</font>
</td></tr>
<tr><td>
<blockquote>
<p>
    Thread metrics are the following:
    </p><dl>
      <dt><tt class="code">&lt;rootMetricsPrefix&gt;test.minAT</tt></dt><dd>Min active threads</dd>
      <dt><tt class="code">&lt;rootMetricsPrefix&gt;test.maxAT</tt></dt><dd>Max active threads</dd>
      <dt><tt class="code">&lt;rootMetricsPrefix&gt;test.meanAT</tt></dt><dd>Mean active threads</dd>
      <dt><tt class="code">&lt;rootMetricsPrefix&gt;test.startedT</tt></dt><dd>Started threads</dd>
      <dt><tt class="code">&lt;rootMetricsPrefix&gt;test.endedT</tt></dt><dd>Finished threads</dd>
    </dl></blockquote>
</td></tr>
<tr><td><br></td></tr>
</table>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="metrics-response-times"><strong>16.1.2 Response times metrics</strong></a>
</font>
</td></tr>
<tr><td>
<blockquote>
<p>Response related metrics are the following:</p><dl>
      <dt><tt class="code">&lt;rootMetricsPrefix&gt;&lt;samplerName&gt;.ok.count</tt></dt>
      <dd>Number of successful responses for sampler name</dd>
      <dt><tt class="code">&lt;rootMetricsPrefix&gt;&lt;samplerName&gt;.h.count</tt></dt>
      <dd>Server hits per seconds, this metric cumulates Sample Result and Sub results (if using Transaction Controller, &quot;Generate parent sampler&quot; should be unchecked)</dd>
      <dt><tt class="code">&lt;rootMetricsPrefix&gt;&lt;samplerName&gt;.ok.min</tt></dt>
      <dd>Min response time for successful responses of sampler name</dd>
      <dt><tt class="code">&lt;rootMetricsPrefix&gt;&lt;samplerName&gt;.ok.max</tt></dt>
      <dd>Max response time for successful responses of sampler name</dd>
      <dt><tt class="code">&lt;rootMetricsPrefix&gt;&lt;samplerName&gt;.ok.avg</tt></dt>
      <dd>Average response time for successful responses of sampler name.</dd>
      <dt><tt class="code">&lt;rootMetricsPrefix&gt;&lt;samplerName&gt;.ok.pct&lt;percentileValue&gt;</tt></dt>
      <dd>Percentile computed for successful responses of sampler name. There will be one metric for each calculated value.</dd>
      <dt><tt class="code">&lt;rootMetricsPrefix&gt;&lt;samplerName&gt;.ko.count</tt></dt>
      <dd>Number of failed responses for sampler name</dd>
      <dt><tt class="code">&lt;rootMetricsPrefix&gt;&lt;samplerName&gt;.ko.min</tt></dt>
      <dd>Min response time for failed responses of sampler name</dd>
      <dt><tt class="code">&lt;rootMetricsPrefix&gt;&lt;samplerName&gt;.ko.max</tt></dt>
      <dd>Max response time for failed responses of sampler name</dd>
      <dt><tt class="code">&lt;rootMetricsPrefix&gt;&lt;samplerName&gt;.ko.avg</tt></dt>
      <dd>Average response time for failed responses of sampler name.</dd>
      <dt><tt class="code">&lt;rootMetricsPrefix&gt;&lt;samplerName&gt;.ko.pct&lt;percentileValue&gt;</tt></dt>
      <dd>Percentile computed for failed responses of sampler name. There will be one metric for each calculated value.</dd>
      <dt><tt class="code">&lt;rootMetricsPrefix&gt;&lt;samplerName&gt;.a.count</tt></dt>
      <dd>Number of responses for sampler name (sum of ok.count and ko.count)</dd>
      <dt><tt class="code">&lt;rootMetricsPrefix&gt;&lt;samplerName&gt;.a.min</tt></dt>
      <dd>Min response time for responses of sampler name (min of ok.count and ko.count)</dd>
      <dt><tt class="code">&lt;rootMetricsPrefix&gt;&lt;samplerName&gt;.a.max</tt></dt>
      <dd>Max response time for responses of sampler name (max of ok.count and ko.count)</dd>
      <dt><tt class="code">&lt;rootMetricsPrefix&gt;&lt;samplerName&gt;.a.avg</tt></dt>
      <dd>Average response time for responses of sampler name (avg of ok.count and ko.count)</dd>
      <dt><tt class="code">&lt;rootMetricsPrefix&gt;&lt;samplerName&gt;.a.pct&lt;percentileValue&gt;</tt></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><p>
    The default <tt class="code">percentiles</tt> setting on the <a href="../usermanual/component_reference.html#Backend_Listener">Backend Listener</a> is &quot;90;95;99&quot;, 
    i.e. the 3 percentiles 90%, 95% and 99%.
    </p><p>
    The <a href="http://graphite.readthedocs.io/en/latest/feeding-carbon.html#step-1-plan-a-naming-hierarchy">Graphite naming hierarchy</a>
    uses dot (&quot;.&quot;) to separate elements. This could be confused with decimal percentile values.
    JMeter converts any such values, replacing dot (&quot;.&quot;) with underscore (&quot;-&quot;). 
    For example, &quot;<tt class="code">99.9</tt>&quot; becomes &quot;<tt class="code">99_9</tt>&quot;
    </p><p>
    By default JMeter sends metrics for all samplers accumulated under the samplerName &quot;<tt class="code">all</tt>&quot;.
    If the Backend Listener <tt class="code">samplersList</tt> is configured, then JMeter also sends the metrics
    for the matching sample names unless <tt class="code">summaryOnly=true</tt>
    </p></blockquote>
</td></tr>
<tr><td><br></td></tr>
</table>
</blockquote>
</td></tr>
<tr><td><br></td></tr>
</table>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="jmeter-configuration"><strong>16.2 JMeter configuration</strong></a>
</font>
</td></tr>
<tr><td>
<blockquote>
<p>
    To make JMeter send metrics to backend add a <a href="./component_reference.html#Backend_Listener">BackendListener</a> using the GraphiteBackendListenerClient.
    </p><table border="0" cellspacing="0" cellpadding="0"><tr><td><img width='902' height='341' src="../../docs/images/screenshots/backend_listener.png"/><br>
<font size="-1">Graphite configuration</font></td></tr></table>
</blockquote>
</td></tr>
<tr><td><br></td></tr>
</table>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="influxdb"><strong>16.2 InfluxDB</strong></a>
</font>
</td></tr>
<tr><td>
<blockquote>
<p>InfluxDB is an open-source, distributed, time-series database that allows to 
easily store metrics.
Installation and configuration is very easy, read this for more details <a href="https://docs.influxdata.com/influxdb/v1.1/introduction/installation/" target="_blank">InfluxDB documentation</a>.<br>
InfluxDB data can be easily viewed in a browser through either <a href="https://github.com/hakobera/influga" target="_blank">Influga</a> or <a href="http://grafana.org/" target="_blank">Grafana</a>.
We will use Grafana in this case.
</p><table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="influxdb_configuration"><strong>16.2.1 InfluxDB graphite listener configuration</strong></a>
</font>
</td></tr>
<tr><td>
<blockquote>
<p>To enable Graphite listener in InfluxDB, edit files <tt class="code">/opt/influxdb/shared/config.toml</tt> or <tt class="code">/usr/local/etc/influxdb.conf</tt>,
    find &quot;<tt class="code">[[graphite]]</tt>&quot; and set this:
    </p><div align="left">
<table cellspacing="4" cellpadding="0" border="0">
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#ffffff"><pre>
# Configure the graphite api
[[graphite]]
enabled = true
bind-address = &quot;:2003&quot; # If not set, is actually set to bind-address.
database = &quot;jmeter&quot;  # store graphite data in this database
    </pre></td>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
</table>
</div>
</blockquote>
</td></tr>
<tr><td><br></td></tr>
</table>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="influxdb_db_configuration"><strong>16.2.2 InfluxDB database configuration</strong></a>
</font>
</td></tr>
<tr><td>
<blockquote>
<p>Connect to InfluxDB using <a href="https://docs.influxdata.com/influxdb/v1.1/introduction/getting_started/">influx shell</a> and <a href="https://docs.influxdata.com/influxdb/v1.1/query_language/database_management/">create two databases</a>:
    <ul>
        <li>grafana : Used by Grafana to store the dashboards we will create</li>
        <li>jmeter : Used by InfluxDB to store the data sent to Graphite Listener as per database=&quot;jmeter&quot; config
        element in <tt class="code">influxdb.conf</tt> or <tt class="code">config.toml</tt></li>
    </ul>
    </p></blockquote>
</td></tr>
<tr><td><br></td></tr>
</table>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="grafana_configuration"><strong>16.2.3 Grafana configuration</strong></a>
</font>
</td></tr>
<tr><td>
<blockquote>
<p>
    Installing grafana is just a matter of putting the unzipped bundle behind an Apache HTTP server.<br>
    Read <a href="http://grafana.org/docs/" targer="_blank">documentation</a> for more details.
    Open <tt class="code">config.js</tt> file and find <tt class="code">datasources</tt> element, and edit it like this:<br>
    </p><div align="left">
<table cellspacing="4" cellpadding="0" border="0">
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#ffffff"><pre>
datasources: {
  influxdb: {
    type: 'influxdb',
    url: &quot;http://influx_db_host:8086/db/jmeter&quot;,
    username: 'root',
    password: 'root',
  },
  grafana: {
    type: 'influxdb',
    url: &quot;http://influx_db_host:8086/db/grafana&quot;,
    username: 'root',
    password: 'root',
    grafanaDB: true
  },
},
    </pre></td>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
</table>
</div>
<p>
<table border="1" bgcolor="#bbbb00" width="50%" cellspacing="0" cellpadding="2">
<tr><td>
    Note that grafana has &quot;<tt class="code">grafanaDB:true</tt>&quot;. Also note that here we use <tt class="code">root</tt> user for simplicity
    It is better to dedicate a special user with restricted rights.
    </td></tr>
</table>
</p>
<table border="0" cellspacing="0" cellpadding="0"><tr><td><img width='1265' height='581' src="../../docs/images/screenshots/grafana_dashboard.png"/><br>
<font size="-1">Grafana dashboard</font></td></tr></table>
</blockquote>
</td></tr>
<tr><td><br></td></tr>
</table>
</blockquote>
</td></tr>
<tr><td><br></td></tr>
</table>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="graphite"><strong>16.3 Graphite</strong></a>
</font>
</td></tr>
<tr><td>
<blockquote>
<p>HELP WELCOME for this section, see <a href="../building.html">Contributing documentation</a></p></blockquote>
</td></tr>
<tr><td><br></td></tr>
</table>
</blockquote>
</p>
</td></tr>
<tr><td><br></td></tr>
</table>
<br>
<table>
<tr>
<td bgcolor="#525D76">
<div align="right"><a href="index.html"><font size=-1 color="#ffffff" face="arial,helvetica,sanserif">Index</font></a></div>
</td>
<td bgcolor="#525D76">
<div align="right"><a href="best-practices.html"><font size=-1 color="#ffffff" face="arial,helvetica,sanserif">Next</font></a></div>
</td>
<td bgcolor="#525D76">
<div align="right"><a href="generating-dashboard.html"><font size=-1 color="#ffffff" face="arial,helvetica,sanserif">Prev</font></a></div>
</td>
</tr>
</table>
</td>
</tr>
<tr><td>
<hr noshade size="1"/>
</td></tr>
<tr>
<td>
<table width=100%>
<tr>
<td>
<font color="#525D76" size="-1"><em>
Copyright &copy; 1999-2017, Apache Software Foundation
</em></font>
</td>
<td align="right">
<font color="#525D76" size="-1"><em>
$Id: realtime-results.xml 1457581 2013-03-17 22:58:08Z sebb $
</em></font>
</td>
</tr>
<tr><td colspan="2">
<div align="center"><font color="#525D76" size="-1">
Apache, Apache JMeter, JMeter, the Apache feather, and the Apache JMeter logo are
trademarks of the Apache Software Foundation.
</font>
</div>
</td></tr>
</table>
</td>
</tr>
</table>
</body>
</html>
<!-- end the processing -->