Collect NUC host metrics live in all JMeter energy scenarios

This commit is contained in:
Steffen committed 2026-10-07 21:03:19 +02:00
1 parent 45a040f3a2
commit a69b9b2118
12 files changed
+602 -21

No files matched your search

+50 -3
View File
@@ -2,7 +2,7 @@
JMeter 5.6.3 is installed on this development computer at `~/.local/bin/jmeter`.
Its launcher uses the installed Java 17; the default Java 26 cannot compile
JMeter's bundled Groovy scripts. No JMeter plugins are needed.
JMeter's bundled Groovy scripts. The `jpgc-perfmon` 2.1 plugin is installed for live server monitoring.
Runs default to **30 minutes of warmup + 4 hours of measurement**. A few additional
seconds allow startup/draining. Only requests entirely inside the four-hour window
@@ -37,6 +37,42 @@ for less frequent patient visits increase `--session-pause-ms` and its deviation
A closed-loop user waits for each response; throughput decreases when the server slows.
Concurrency means resident simulated users, including their idle/thinking time.
## Live NUC monitoring in JMeter
All six plans contain **jp@gc – PerfMon Metrics Collector**, including idle.
The listener connects over TCP to the agent on the target (default port 4444),
samples every five seconds, and writes `perfmon.csv` directly on this computer
through JMeter during the run. No server log transfer is needed. In GUI mode the
listener shows live graphs; use CLI mode for actual energy experiments.
Collected host metrics: CPU combined utilisation and I/O wait (%), memory usage
(% and actual-used bytes), swap-used bytes, disk read/write bytes per second,
and network received/sent bytes per second. These are system totals, not per-service
attribution. Network/disk counters depend on SIGAR's device support; zero values on
an idle host do not establish their accuracy. Compare the readings against Linux
utilities before treating the agent as a validated measurement instrument.
The runner checks agent access/metric availability before starting. It records
`--perfmon-host`, `--perfmon-port` and `--perfmon-interval-ms` (default 5000) in
`run.json`; by default the agent host matches `--host`. Failed, missing or widely
spaced measurements invalidate monitoring. `perfmon-measured.csv` excludes warmup,
decodes the plugin's synthetic `elapsed` field into metric values/units, and retains
timestamps from this computer's collector, not server-origin timestamps.
**PerfMon's elapsed field is not HTTP latency.** Host metrics stay separate
from application request counts. Raw `perfmon.csv` contains warmup and measured data.
`run.json` also includes each metric's sample count, mean and maximum.
Keep the agent running on the NUC for the full warmup and measured run. Its TCP
connection is plain-text and provides no authentication; restrict port 4444 to the
load-generator computer. Restart it with `--no-exec --udp-port 0 --tcp-port 4444`
to disable the agent's executable custom metrics; these plans use only built-in metrics.
`--no-perfmon` is for isolated workflow testing and explicitly records that no server
monitoring was collected. The plugin must still be installed to load its JMX element.
The validation fixture uses this switch and does not connect to the NUC.
[PerfMon listener documentation](https://jmeter-plugins.org/wiki/PerfMon/),
[agent metrics/protocol](https://github.com/undera/perfmon-agent).
## 1. Prepare distinct test accounts (outside measurement)
The installer initially supplies only one ordinary patient account. Use distinct
@@ -140,12 +176,12 @@ Use the same-duration `idle` run to establish baseline power:
python3 tools/energy-jmeter/run.py idle --host 192.168.1.125 --ca tools/energy-jmeter/.private/healthapp-ca.crt --warmup 1800 --duration 14400 --output tools/energy-jmeter/results/idle-run1
```
The idle runner sends one TLS preflight request before the observation period.
The idle runner sends one TLS preflight request before the observation period, then uses a JMeter idle plan with live PerfMon collection.
The application services/PostgreSQL stay running. The load generator and HTML-report
creation stay on this computer, outside the NUC's energy measurement. Keep server
power settings, dataset, service versions, logging and other workloads consistent.
Record those settings, thermal state, meter sampling interval and clock synchronisation.
Repeat runs and vary their order to check drift. No live NUC load has been run by Codex.
Repeat runs and vary their order to check drift. Only a brief monitoring-only JMeter check has been run against the NUC; no application load has been sent by Codex.
## 4. Read results and energy
@@ -177,6 +213,7 @@ but does not provide certificate validation. Do not describe this as a TLS secur
```bash
python3 tools/energy-jmeter/generate-plans.py
python3 tools/energy-jmeter/verify-plans.py
python3 tools/energy-jmeter/verify-perfmon.py
```
The validation script exercises every plan against an isolated local HTTPS contract
@@ -187,3 +224,13 @@ suite. The real-server short capacity trial is required before a four-hour measu
References: [Apache release](https://jmeter.apache.org/download_jmeter.cgi),
[CLI load testing](https://jmeter.apache.org/usermanual/get-started.html),
[JMeter components](https://jmeter.apache.org/usermanual/component_reference.html).
For a short live monitoring-only check (no patient requests):
```bash
python3 tools/energy-jmeter/verify-perfmon.py --host 192.168.1.125 --output tools/energy-jmeter/results/perfmon-check-new
```
This verifies that JMeter saves readings while it is still running, then checks
metric coverage and decoding. A monitoring-only check succeeded against the NUC;
comparison with independent Linux readings is still needed to validate accuracy.