Skip to content
Tracon

RunScoreBucketing

Namespace Tracon · Assembly Tracon.Abstractions.dll

Shared pure logic for score trend bucket truncation (RunScoreBucket).

public static class RunScoreBucketing

objectRunScoreBucketing

object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Used by InMemoryRunScoreStore directly; each SQL provider mirrors the same rule in its own date-truncation SQL, so the bucket boundary never diverges between implementations — a shared contract test checks this across all four.

Rounds a timestamp down to its bucket boundary, in UTC.

public static DateTimeOffset Truncate(DateTimeOffset value, RunScoreBucket bucket)

value DateTimeOffset

The timestamp to round down.

bucket RunScoreBucket

The bucket width.

DateTimeOffset

The bucket’s start (UTC). A RunScoreBucket.Week bucket starts on Monday (ISO 8601).