Class ProbeSchedule

Namespace
Kuestenlogik.Bowire.Monitoring
Assembly
Kuestenlogik.Bowire.Monitoring.dll

When a probe runs (#102, Decision 1). v1 accepts an interval (every 60s, every 5m, every 2h) optionally bounded by a UTC time-of-day window and a weekday set (every 5m, 09:00-17:00 UTC, Mon-Fri). Anything the parser can't model returns a clear error rather than silently approximating — the operator sees "unsupported schedule" and the probe simply isn't scheduled. Full cron expressions are a follow-up.

public sealed class ProbeSchedule
Inheritance
ProbeSchedule
Inherited Members

Properties

Interval

The base cadence — the gap between successive runs.

public TimeSpan Interval { get; }

Property Value

TimeSpan

Window

Optional bounding window; null means "any time, any day".

public ProbeWindow? Window { get; }

Property Value

ProbeWindow

Methods

DelayUntilNext(DateTimeOffset?, DateTimeOffset)

Non-negative delay from now until the next run.

public TimeSpan DelayUntilNext(DateTimeOffset? lastRun, DateTimeOffset now)

Parameters

lastRun DateTimeOffset?
now DateTimeOffset

Returns

TimeSpan

NextRunAt(DateTimeOffset?, DateTimeOffset)

The instant the probe should next run, given its last recorded run and the current time (Decision 2). A never-run probe (lastRun null) runs immediately; missed ticks collapse to a single liveness run at now (no back-fill); a window, when present, advances the candidate to the next in-window instant.

public DateTimeOffset NextRunAt(DateTimeOffset? lastRun, DateTimeOffset now)

Parameters

lastRun DateTimeOffset?
now DateTimeOffset

Returns

DateTimeOffset

TryParse(string?, out ProbeSchedule?, out string?)

Parse a schedule spec. Returns false with a human-readable error when the spec can't be modelled — the caller logs it and skips scheduling that probe (visible, non-silent).

public static bool TryParse(string? spec, out ProbeSchedule? schedule, out string? error)

Parameters

spec string
schedule ProbeSchedule
error string

Returns

bool