How to Visualize JMeter Performance Data with Grafana, InfluxDB, and Prometheus
This guide explains step‑by‑step how to configure JMeter’s Backend Listener to send metrics to InfluxDB, set up Prometheus and node_exporter, and create Grafana dashboards for real‑time TPS, response time, and system resource monitoring.
Performance testing often requires monitoring many components such as OS, middleware, queues, caches, databases, and front‑end services. This article focuses on the most common monitoring stack—Grafana, InfluxDB, Prometheus, and Exporters—and shows how to integrate JMeter and node_exporter into it.
1. JMeter + InfluxDB + Grafana data flow
JMeter normally displays results in its console, plugins, or generated HTML, but these methods waste time and memory. Using the Backend Listener, JMeter can asynchronously send metrics (TPS, response time, thread count, error rate) to InfluxDB every 30 seconds (configurable via #summariser.interval in jmeter.properties).
The InfluxDB schema creates two measurements: events (stores test‑tile and event tags) and jmeter (stores per‑transaction statistics). Grafana reads from the jmeter measurement to plot time‑series graphs.
Backend Listener configuration
private void addMetrics(String transaction, SamplerMetric metric) {
// ALL status
addMetric(transaction, metric.getTotal(), metric.getSentBytes(), metric.getReceivedBytes(), TAG_ALL, metric.getAllMean(), metric.getAllMinTime(),
metric.getAllMaxTime(), allPercentiles.values(), metric::getAllPercentile);
// OK status
addMetric(transaction, metric.getSuccesses(), null, null, TAG_OK, metric.getOkMean(), metric.getOkMinTime(),
metric.getOkMaxTime(), okPercentiles.values(), metric::getOkPercentile);
// KO status
addMetric(transaction, metric.getFailures(), null, null, TAG_KO, metric.getKoMean(), metric.getKoMinTime(),
metric.getKoMaxTime(), koPercentiles.values(), metric::getKoPercentile);
metric.getErrors().forEach((error, count) -> addErrorMetric(transaction, error.getResponseCode(),
error.getResponseMessage(), count));
}Metrics are then sent to InfluxDB via writeAndSendMetrics, which builds line protocol strings and posts them with an HTTP request.
2. InfluxDB storage example
> show databases
name
----
_internal
jmeter
> use jmeter
Using database jmeter
> show measurements
name
----
events
jmeter
> select * from jmeter where application='7ddemo' limit 10
...The jmeter measurement contains fields such as avg, count, pct95.0, etc., which Grafana queries to draw TPS and response‑time curves.
3. Grafana dashboard setup
Configure an InfluxDB data source (URL, database, user, password) and import the official JMeter dashboard (ID 5496). Example queries:
SELECT last("count") / $send_interval FROM "$measurement_name" WHERE ("transaction" =~ /^$transaction$/ AND "statut" = 'ok') AND $timeFilter GROUP BY time($__interval)for TPS, and
SELECT mean("pct95.0") FROM "$measurement_name" WHERE ("application" =~ /^$application$/) AND $timeFilter GROUP BY "transaction", time($__interval) fill(null)for the 95th‑percentile response time.
4. node_exporter + Prometheus + Grafana data flow
node_exporter collects OS metrics (CPU, memory, etc.) from /proc and exposes them to Prometheus. After downloading and extracting Prometheus, add a job to prometheus.yml:
- job_name: 's1'
static_configs:
- targets: ['172.17.211.143:9200']Start Prometheus and configure Grafana to use it as a data source. Import the official node_exporter dashboard (ID 11074).
Example Prometheus queries for CPU usage
avg(irate(node_cpu_seconds_total{instance=~"$node",mode="system"}[30m])) by (instance)
avg(irate(node_cpu_seconds_total{instance=~"$node",mode="user"}[30m])) by (instance)
avg(irate(node_cpu_seconds_total{instance=~"$node",mode="iowait"}[30m])) by (instance)
1 - avg(irate(node_cpu_seconds_total{instance=~"$node",mode="idle"}[30m])) by (instance)These queries retrieve CPU usage percentages, which are displayed alongside top‑like values for verification.
5. Summary
Understanding where monitoring data originates—whether from JMeter’s Backend Listener, node_exporter, or other Exporters—is essential for accurate performance analysis. The described stack provides a real‑time, queryable view of test metrics and system resources, avoiding the overhead of HTML reports while preserving the ability to compare and replay data after a test run.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
dbaplus Community
Enterprise-level professional community for Database, BigData, and AIOps. Daily original articles, weekly online tech talks, monthly offline salons, and quarterly XCOPS&DAMS conferences—delivered by industry experts.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
