Class BowireBenchmarkSchedule

Namespace
Kuestenlogik.Bowire.Benchmarking
Assembly
Kuestenlogik.Bowire.Benchmarking.dll

A benchmark that fires on a cron schedule (#232).

The schedule carries the whole request rather than pointing at a workbench envelope on purpose: envelopes live in the browser's localStorage, and a hosted service running in the server process cannot read those. Persisting what to call — and how hard — next to the cron expression is what lets a schedule survive a restart and run with no operator present, which is the point of the ticket.

public sealed class BowireBenchmarkSchedule
Inheritance
BowireBenchmarkSchedule
Inherited Members

Constructors

BowireBenchmarkSchedule()

public BowireBenchmarkSchedule()

Properties

Body

Request body, if the method takes one.

[JsonPropertyName("body")]
public string? Body { get; set; }

Property Value

string

Concurrency

Calls in flight at once.

[JsonPropertyName("concurrency")]
public int Concurrency { get; set; }

Property Value

int

Cron

Standard 5-field cron expression (minute hour day month day-of-week).

[JsonPropertyName("cron")]
public string Cron { get; set; }

Property Value

string

Enabled

Whether the schedule fires. A paused schedule is kept, not deleted.

[JsonPropertyName("enabled")]
public bool Enabled { get; set; }

Property Value

bool

Id

Stable id — the file name in the store and the CLI / API handle.

[JsonPropertyName("id")]
public string Id { get; set; }

Property Value

string

Iterations

Calls per run.

[JsonPropertyName("iterations")]
public int Iterations { get; set; }

Property Value

int

Method

Method to call.

[JsonPropertyName("method")]
public string Method { get; set; }

Property Value

string

Name

Human-readable name for the workbench list.

[JsonPropertyName("name")]
public string Name { get; set; }

Property Value

string

Protocol

Protocol plugin id (rest, grpc, …).

[JsonPropertyName("protocol")]
public string Protocol { get; set; }

Property Value

string

ServerUrl

Target server URL.

[JsonPropertyName("serverUrl")]
public string ServerUrl { get; set; }

Property Value

string

Service

Service to call.

[JsonPropertyName("service")]
public string Service { get; set; }

Property Value

string

Thresholds

Threshold specs (p95 < 200) evaluated after each run.

[JsonPropertyName("thresholds")]
public List<string> Thresholds { get; init; }

Property Value

List<string>

Timezone

IANA timezone id the cron expression is interpreted in (e.g. Europe/Berlin). Empty means UTC — never the host's local zone, which would make the same schedule fire at different wall-clock times on a developer laptop and a CI runner.

[JsonPropertyName("timezone")]
public string Timezone { get; set; }

Property Value

string

Warmup

Calls made and discarded before measuring.

[JsonPropertyName("warmup")]
public int Warmup { get; set; }

Property Value

int

Methods

NextOccurrenceUtc(DateTime)

Next firing time after afterUtc, or null when the schedule is disabled or its expression doesn't parse. Cronos handles the DST cases — a 02:30 daily schedule has no occurrence on a spring-forward night and two on the way back.

public DateTime? NextOccurrenceUtc(DateTime afterUtc)

Parameters

afterUtc DateTime

Returns

DateTime?

ResolveTimeZone()

Resolve Timezone, falling back to UTC when it is empty or the host doesn't know the id — an unknown zone should shift the firing time, not stop the schedule.

public TimeZoneInfo ResolveTimeZone()

Returns

TimeZoneInfo

ToRequest()

Project the schedule onto a runner request.

public BowireBenchmarkRequest ToRequest()

Returns

BowireBenchmarkRequest

TryGetCronExpression(out CronExpression?, out string?)

Parse Cron, returning false with a message rather than throwing — a bad expression in a stored file must not take down the hosted service on boot.

public bool TryGetCronExpression(out CronExpression? expression, out string? error)

Parameters

expression CronExpression
error string

Returns

bool