@@ -138,7 +138,7 @@ def series_label(result: "NightlyResult") -> str:
138138class NightlyResult :
139139 """A single nightly benchmark result with embedded config and machine info."""
140140
141- date : str
141+ date : str # Commit date (YYYY-MM-DD) - displayed on chart X-axis
142142 commit : str
143143 mean : float
144144 stddev : float
@@ -147,6 +147,7 @@ class NightlyResult:
147147 str , Any
148148 ] # Full benchmark config (dbcache inside config.bitcoind.dbcache)
149149 machine : dict [str , Any ] # Full machine specs
150+ run_date : str = "" # When benchmark was executed (reference only)
150151
151152 @property
152153 def dbcache (self ) -> int :
@@ -168,7 +169,7 @@ def instrumentation(self) -> str:
168169
169170 def to_dict (self ) -> dict [str , Any ]:
170171 """Convert to dictionary for JSON serialization."""
171- return {
172+ result = {
172173 "date" : self .date ,
173174 "commit" : self .commit ,
174175 "mean" : self .mean ,
@@ -177,6 +178,9 @@ def to_dict(self) -> dict[str, Any]:
177178 "config" : self .config ,
178179 "machine" : self .machine ,
179180 }
181+ if self .run_date :
182+ result ["run_date" ] = self .run_date
183+ return result
180184
181185 @classmethod
182186 def from_dict (cls , data : dict [str , Any ]) -> NightlyResult :
@@ -194,6 +198,7 @@ def from_dict(cls, data: dict[str, Any]) -> NightlyResult:
194198 runs = data ["runs" ],
195199 config = data ["config" ],
196200 machine = data .get ("machine" , {}),
201+ run_date = data .get ("run_date" , "" ),
197202 )
198203
199204 # Legacy format - convert to new format
@@ -209,6 +214,7 @@ def from_dict(cls, data: dict[str, Any]) -> NightlyResult:
209214 "instrumentation" : "uninstrumented" ,
210215 },
211216 machine = {},
217+ run_date = data .get ("run_date" , "" ),
212218 )
213219
214220
@@ -316,6 +322,7 @@ def append_from_results_json(
316322 benchmark_config : dict [str , Any ],
317323 machine_specs : dict [str , Any ],
318324 date_str : str | None = None ,
325+ run_date : str = "" ,
319326 ) -> None :
320327 """Append result from a hyperfine results.json file.
321328
@@ -324,7 +331,8 @@ def append_from_results_json(
324331 commit: Git commit hash
325332 benchmark_config: Full benchmark config dict (includes bitcoind.dbcache)
326333 machine_specs: Machine specs dict
327- date_str: Date string (YYYY-MM-DD), defaults to today
334+ date_str: Commit date string (YYYY-MM-DD), defaults to today
335+ run_date: When the benchmark was executed (YYYY-MM-DD), for reference
328336 """
329337 if not results_file .exists ():
330338 raise FileNotFoundError (f"Results file not found: { results_file } " )
@@ -355,6 +363,7 @@ def append_from_results_json(
355363 runs = runs ,
356364 config = benchmark_config ,
357365 machine = machine_specs ,
366+ run_date = run_date ,
358367 )
359368 self .append (result )
360369
@@ -391,17 +400,19 @@ def append(
391400 benchmark_config_file : Path | None = None ,
392401 instrumentation : str = "uninstrumented" ,
393402 machine_specs_file : Path | None = None ,
403+ run_date : str = "" ,
394404 ) -> None :
395405 """Append a result from hyperfine results.json to history.
396406
397407 Args:
398408 results_file: Path to hyperfine results.json
399409 commit: Git commit hash
400410 dbcache: DB cache size in MB
401- date_str: Date string (YYYY-MM-DD), defaults to today
411+ date_str: Commit date string (YYYY-MM-DD), defaults to today
402412 benchmark_config_file: Path to benchmark config TOML
403413 instrumentation: Instrumentation mode ('uninstrumented' or 'instrumented')
404414 machine_specs_file: Path to pre-captured machine specs JSON (optional)
415+ run_date: When the benchmark was executed (YYYY-MM-DD), for reference
405416 """
406417 from bench .benchmark_config import BenchmarkConfig
407418
@@ -435,6 +446,7 @@ def append(
435446 benchmark_config = config_dict ,
436447 machine_specs = machine_specs ,
437448 date_str = date_str ,
449+ run_date = run_date ,
438450 )
439451 history .save ()
440452
0 commit comments