Skip to content

Commit 4a1db60

Browse files
committed
feat: align benchmark reports for v0.2.2
1 parent e83b375 commit 4a1db60

21 files changed

Lines changed: 1655 additions & 190 deletions

‎pyproject.toml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "pg-perf-bench"
7-
version = "0.2.1"
7+
version = "0.2.2"
88
description = "Reproducible PostgreSQL TPS benchmarks with environment evidence and report comparison"
99
readme = "README.md"
1010
requires-python = ">=3.10"
@@ -17,7 +17,7 @@ license-files = [
1717
"src/pg_perf_bench/templates/vendor/THIRD_PARTY_LICENSES.txt",
1818
]
1919
authors = [
20-
{ name = "O2eg", email = "oleg.ispu@yandex.ru" },
20+
{ name = "O2eg", email = "oleg.ispu@gmail.com" },
2121
]
2222
keywords = ["postgresql", "benchmark", "pgbench", "performance", "diagnostics"]
2323
dependencies = [

‎src/pg_perf_bench/__init__.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""PostgreSQL performance benchmark and evidence collector."""
22

3-
__version__ = '0.2.1'
3+
__version__ = '0.2.2'

‎src/pg_perf_bench/benchmark.py‎

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,44 @@ def setup_report_structure(report_conf: dict, logger) -> dict:
446446
logger.info('Report structure initialized.')
447447
return report
448448

449+
@staticmethod
450+
def build_invocation_summary(
451+
conn_type: str,
452+
db_conf: dict[str, Any],
453+
workload_conf: dict[str, Any],
454+
) -> dict[str, Any]:
455+
"""Return the safe, user-facing parameters that define a benchmark run."""
456+
return {
457+
'schema_version': 'pg_perf_bench/invocation-v1',
458+
'mode': 'benchmark',
459+
'connection_type': str(conn_type),
460+
'database': {
461+
'host': db_conf.get('host'),
462+
'port': db_conf.get('port'),
463+
'name': db_conf.get('database'),
464+
'user': db_conf.get('user'),
465+
},
466+
'workload': {
467+
'profile': workload_conf.get('workload_profile'),
468+
'scale': workload_conf.get('workload_scale'),
469+
'duration_seconds': workload_conf.get('workload_duration_seconds'),
470+
'iteration_parameter': workload_conf.get('pgbench_iter_name'),
471+
'iteration_values': list(workload_conf.get('pgbench_iter_list') or []),
472+
},
473+
'metrics': {
474+
'engine': 'pg_diag',
475+
'interval_seconds': workload_conf.get('system_metrics_interval'),
476+
'duration_override_seconds': workload_conf.get('system_metrics_duration'),
477+
},
478+
'safety': {
479+
'database_recreated_before_each_iteration': True,
480+
'database_reset_authorized': bool(workload_conf.get('allow_database_reset')),
481+
'os_caches_dropped_before_each_iteration': bool(
482+
workload_conf.get('drop_os_caches')
483+
),
484+
},
485+
}
486+
449487
@staticmethod
450488
def setup_connection(conn_type: str, conn_conf: dict, logger):
451489
"""
@@ -559,6 +597,11 @@ async def run_benchmark_and_collect_metrics(
559597

560598
try:
561599
report = BenchmarkRunner.setup_report_structure(report_conf, logger)
600+
report['invocation'] = BenchmarkRunner.build_invocation_summary(
601+
conn_type,
602+
db_conf,
603+
workload_conf,
604+
)
562605
load_iterations = BenchmarkRunner.load_iterations_config(db_conf, workload_conf)
563606
if not load_iterations:
564607
logger.error('No valid load iterations configured.')

‎src/pg_perf_bench/templates/all_info_report_struct.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "",
55
"sections": {
66
"system": {
7-
"header": "System properties <hn>",
7+
"header": "System properties",
88
"description": "Common info about current host",
99
"state": "expanded",
1010
"reports": {

‎src/pg_perf_bench/templates/benchmark_report_struct.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "",
55
"sections": {
66
"system": {
7-
"header": "System properties <hn>",
7+
"header": "System properties",
88
"description": "Common info about current host",
99
"state": "expanded",
1010
"reports": {

0 commit comments

Comments
 (0)