mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-09 06:22:57 +00:00
Move logic for ingest benchmark from GitHub workflow into python testcase (#9762)
## Problem The first version of the ingest benchmark had some parsing and reporting logic in shell script inside GitHub workflow. it is better to move that logic into a python testcase so that we can also run it locally. ## Summary of changes - Create new python testcase - invoke pgcopydb inside python test case - move the following logic into python testcase - determine backpressure - invoke pgcopydb and report its progress - parse pgcopydb log and extract metrics - insert metrics into perf test database - add additional column to perf test database that can receive endpoint ID used for pgcopydb run to have it available in grafana dashboard when retrieving other metrics for an endpoint ## Example run https://github.com/neondatabase/neon/actions/runs/11860622170/job/33056264386
This commit is contained in:
@@ -256,12 +256,17 @@ class NeonBenchmarker:
|
||||
metric_value: float,
|
||||
unit: str,
|
||||
report: MetricReport,
|
||||
labels: Optional[
|
||||
dict[str, str]
|
||||
] = None, # use this to associate additional key/value pairs in json format for associated Neon object IDs like project ID with the metric
|
||||
):
|
||||
"""
|
||||
Record a benchmark result.
|
||||
"""
|
||||
# just to namespace the value
|
||||
name = f"{self.PROPERTY_PREFIX}_{metric_name}"
|
||||
if labels is None:
|
||||
labels = {}
|
||||
self.property_recorder(
|
||||
name,
|
||||
{
|
||||
@@ -269,6 +274,7 @@ class NeonBenchmarker:
|
||||
"value": metric_value,
|
||||
"unit": unit,
|
||||
"report": report,
|
||||
"labels": labels,
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user