Class BowireBenchmarkScheduleStore
- Namespace
- Kuestenlogik.Bowire.Benchmarking
- Assembly
- Kuestenlogik.Bowire.Benchmarking.dll
On-disk store for benchmark schedules and their run history (#232),
under .bowire/benchmark-schedules/.
Persistence is the restart-survival requirement: the hosted
service holds no schedule state of its own, it re-reads this directory on
boot. One JSON file per schedule, plus a sibling
<id>.runs.json holding the newest-first history, so a run
appended by a firing never rewrites the schedule definition an operator
may be editing.
public sealed class BowireBenchmarkScheduleStore
- Inheritance
-
BowireBenchmarkScheduleStore
- Inherited Members
Constructors
BowireBenchmarkScheduleStore(string?)
Create a store rooted at rootPath (defaults to the current directory).
public BowireBenchmarkScheduleStore(string? rootPath = null)
Parameters
rootPathstring
Fields
DirectoryName
Directory name under the project's .bowire folder.
public const string DirectoryName = "benchmark-schedules"
Field Value
MaxRunsPerSchedule
How many runs are kept per schedule before the oldest are dropped.
public const int MaxRunsPerSchedule = 50
Field Value
Properties
Directory
The resolved schedules directory.
public string Directory { get; }
Property Value
Methods
AppendRunAsync(BowireBenchmarkScheduleRun, CancellationToken)
Prepend a run to the schedule's history, trimming to MaxRunsPerSchedule. Newest-first so a reader wanting "how did the last run go?" takes the first element.
public Task AppendRunAsync(BowireBenchmarkScheduleRun run, CancellationToken ct = default)
Parameters
Returns
Delete(string)
Remove a schedule and its history. Returns false when it wasn't there.
public bool Delete(string id)
Parameters
idstring
Returns
LoadAllAsync(CancellationToken)
Every stored schedule. A missing directory is an empty list, and an unreadable or malformed file is skipped — one bad file must not stop the other schedules from running.
public Task<List<BowireBenchmarkSchedule>> LoadAllAsync(CancellationToken ct = default)
Parameters
Returns
LoadAsync(string, CancellationToken)
Read one schedule by id, or null when it isn't stored.
public Task<BowireBenchmarkSchedule?> LoadAsync(string id, CancellationToken ct = default)
Parameters
idstringctCancellationToken
Returns
LoadRunsAsync(string, CancellationToken)
Run history for a schedule, newest first.
public Task<List<BowireBenchmarkScheduleRun>> LoadRunsAsync(string id, CancellationToken ct = default)
Parameters
idstringctCancellationToken
Returns
SaveAsync(BowireBenchmarkSchedule, CancellationToken)
Write a schedule, creating the directory when needed.
public Task<string> SaveAsync(BowireBenchmarkSchedule schedule, CancellationToken ct = default)
Parameters
scheduleBowireBenchmarkSchedulectCancellationToken