Archive the four thesis measurement runs

This commit is contained in:
Steffen committed 2026-11-24 16:25:10 +01:00
1 parent 546f818b68
commit 2009b464d5
13 files changed
+184

No files matched your search

@@ -0,0 +1,22 @@
# HealthApp thesis measurement data
This export contains the four completed runs used in the thesis comparison. Architecture A was measured in October 2026. The selected Architecture B review and idle runs were measured on 23 and 24 November 2026 respectively, with direct LAN PerfMon. The interrupted November idle run and the superseded October B runs are outside this dataset.
| File | Contents |
| --- | --- |
| runs.json | Original run identifiers, scenario and warmup, scheduled measurement timestamps, exact analysis boundaries, workload plan SHA-256 and verified HTTP counts |
| shelly.csv.gz | Raw timestamp, poll duration, power in W, and accumulated energy in Wh. Contains 14,400 analysis readings and only the nearby counter-update anchors needed for the five-minute comparison |
| cpu.csv.gz | Timestamps and JMeter's encoded elapsed values for the PerfMon CPU combined metric inside the analysis window. Divide the encoded values by 1,000 to obtain CPU percent |
| http.csv.gz | JMeter application HTTP start timestamps, elapsed milliseconds, fixed sampler labels and success status. Present for loaded runs. Idle logs were checked for application requests and had none |
Timestamps are Unix epoch milliseconds in UTC. Shelly readings are placed at the midpoint of their polling request. The first and 14,400th power readings at or after the scheduled measurement start define the analysis bounds. The whole-window energy calculation treats each power reading as one nominal second, and the accumulated counter uses the recorded values at the two bounds. For the five-minute comparison, the power is integrated at its actual timestamps, and counter values at the 48 window boundaries are linearly estimated from nearby update events. The counter anchors are used only for that comparison.
An HTTP request is included only if it starts and ends within the analysis bounds. To recreate the request and response-time plots, bin requests by the floor of seconds since the analysis start and calculate the count, mean elapsed time, and failed count in each bin. The four runs used JMeter 5.6.3. The loaded runs each used 26 threads and the review scenario with a single synthetic test account.
Run the following from the repository root to recalculate the tables and the 48 window differences used as input to each panel of the Shelly figure.
```sh
python3 tools/energy-jmeter/evidence/thesis-runs/summarize.py
```
The export uses an explicit field allowlist. It excludes URLs, account and patient identifiers, credentials, tokens, response bodies, test input fixtures, monitoring addresses, and logs. The source paths in the manifest identify the original local runs. The full instrumentation output remains in the original result folders.
@@ -0,0 +1,58 @@
{
"a-idle-2026-10-08": {
"scenario": "idle",
"users": 0,
"warmup_seconds": 1800,
"measurement_duration_seconds": 14400,
"measurement_start_ms": 1791457892014,
"measurement_end_ms": 1791472292014,
"plan_sha256": "6d3457d41a6a8d4221157f9c0b692506fb5a89544a9786ad7fd5a85d4950cdba",
"source_run": "HealthAppRepository/tools/energy-jmeter/results/idle-20261008T104130Z",
"analysis_start_ms": 1791457892305.5,
"analysis_end_ms": 1791472292459.0,
"application_requests": 0,
"failed_application_requests": 0
},
"a-load-2026-10-09": {
"scenario": "review",
"users": 26,
"warmup_seconds": 1800,
"measurement_duration_seconds": 14400,
"measurement_start_ms": 1791544912005,
"measurement_end_ms": 1791559312005,
"plan_sha256": "e93cbc3718c5ce2b387a191ae86228221a9f2357894d0d24bf6c48434c4718b9",
"source_run": "HealthAppRepository/tools/energy-jmeter/results/loaded-26-20261009T105149Z",
"analysis_start_ms": 1791544912192.0,
"analysis_end_ms": 1791559312327.5,
"application_requests": 327200,
"failed_application_requests": 0
},
"b-idle-2026-11-24": {
"scenario": "idle",
"users": 0,
"warmup_seconds": 1800,
"measurement_duration_seconds": 14400,
"measurement_start_ms": 1795511895899,
"measurement_end_ms": 1795526295899,
"plan_sha256": "6d3457d41a6a8d4221157f9c0b692506fb5a89544a9786ad7fd5a85d4950cdba",
"source_run": "HealthAppRepositoryB/tools/energy-jmeter/results/direct-b-20261123T160817Z/idle-retry-20261124",
"analysis_start_ms": 1795511896193.5,
"analysis_end_ms": 1795526296270.0,
"application_requests": 0,
"failed_application_requests": 0
},
"b-load-2026-11-23": {
"scenario": "review",
"users": 26,
"warmup_seconds": 1800,
"measurement_duration_seconds": 14400,
"measurement_start_ms": 1795451899435,
"measurement_end_ms": 1795466299435,
"plan_sha256": "e93cbc3718c5ce2b387a191ae86228221a9f2357894d0d24bf6c48434c4718b9",
"source_run": "HealthAppRepositoryB/tools/energy-jmeter/results/direct-b-20261123T160817Z/review",
"analysis_start_ms": 1795451899602.5,
"analysis_end_ms": 1795466299429.5,
"application_requests": 370181,
"failed_application_requests": 0
}
}
@@ -0,0 +1,104 @@
#!/usr/bin/env python3
"""Recalculate the thesis tables and Shelly agreement from the exported CSV data."""
import csv
import gzip
import json
import math
from bisect import bisect_right
from pathlib import Path
from statistics import mean, median
HERE = Path(__file__).resolve().parent
def read_csv(path):
with gzip.open(path, "rt", encoding="utf-8", newline="") as source:
yield from csv.DictReader(source)
def interpolate(points, x):
"""Interpolate between adjacent points or extend the nearest segment."""
i = max(0, min(bisect_right(points, (x, math.inf)) - 1, len(points) - 2))
left, right = points[i], points[i + 1]
return left[1] + (right[1] - left[1]) * (x - left[0]) / (right[0] - left[0])
def shelly_agreement(all_power, power, start, duration):
integrated = [(0.0, 0.0)]
for left, right in zip(power, power[1:]):
elapsed_seconds = (right[0] - left[0]) / 1_000
interval_wh = elapsed_seconds * (left[1] + right[1]) / 7_200
integrated.append(((right[0] - start) / 1_000, integrated[-1][1] + interval_wh))
counter_updates = [
((right[0] - start) / 1_000, right[2])
for left, right in zip(all_power, all_power[1:])
if right[2] > left[2]
]
edges = [duration * i / 48 for i in range(49)]
integrated_wh = [interpolate(integrated, edge) for edge in edges]
counter_wh = [interpolate(counter_updates, edge) for edge in edges]
return [
100 * ((c1 - c0) / (p1 - p0) - 1)
for p0, p1, c0, c1 in zip(
integrated_wh, integrated_wh[1:], counter_wh, counter_wh[1:]
)
]
def summarize(folder, run):
start, end = run["analysis_start_ms"], run["analysis_end_ms"]
duration = (end - start) / 1_000
all_power = [
(
int(row["timestamp_ms"]) + int(row["poll_elapsed_ms"]) / 2,
float(row["power_w"]),
float(row["counter_wh"]),
)
for row in read_csv(folder / "shelly.csv.gz")
]
power = [row for row in all_power if start <= row[0] <= end]
if len(power) != 14_400 or (power[0][0], power[-1][0]) != (start, end):
raise ValueError(f"{folder.name}: incorrect Shelly window")
joules = sum(row[1] for row in power)
hourly_means = [
mean(row[1] for row in power[index:index + 3_600])
for index in range(0, len(power), 3_600)
]
cpu = [int(row["jmeter_elapsed"]) / 1_000 for row in read_csv(folder / "cpu.csv.gz")]
agreement = shelly_agreement(all_power, power, start, duration)
http_file = folder / "http.csv.gz"
http = list(read_csv(http_file)) if http_file.is_file() else []
elapsed = sorted(int(row["elapsed_ms"]) for row in http)
failures = sum(row["success"] != "true" for row in http)
if (len(http), failures) != (run["application_requests"], run["failed_application_requests"]):
raise ValueError(f"{folder.name}: HTTP counts differ from the manifest")
result = {
"power_samples": len(power),
"analysis_duration_seconds": duration,
"mean_power_w": mean(row[1] for row in power),
"hourly_mean_power_range_w": max(hourly_means) - min(hourly_means),
"energy_j": joules,
"energy_kwh": joules / 3_600_000,
"counter_delta_wh": power[-1][2] - power[0][2],
"mean_cpu_percent": mean(cpu),
"application_requests": len(http),
"failed_application_requests": failures,
"shelly_agreement_5_minute_windows_percent": agreement,
}
if elapsed:
result.update(
requests_per_second=len(elapsed) / duration,
mean_response_ms=mean(elapsed),
median_response_ms=median(elapsed),
p95_response_ms=elapsed[math.ceil(0.95 * len(elapsed)) - 1],
joules_per_successful_request=joules / (len(elapsed) - failures),
)
return result
if __name__ == "__main__":
runs = json.loads((HERE / "runs.json").read_text(encoding="utf-8"))
print(json.dumps({key: summarize(HERE / key, run) for key, run in runs.items()}, indent=2))