test(streaming): enforce slice E physical evidence
Record route-lifetime streaming overruns and maximum operation costs, require canonical reveal/resource convergence at every connected checkpoint, and keep recenter semantics independent of the production wall-clock budget. Co-authored-by: Erik Nilsson <erikn@users.noreply.github.com>
This commit is contained in:
parent
2ff8f844b0
commit
621f70eab6
6 changed files with 215 additions and 4 deletions
|
|
@ -155,6 +155,8 @@ public readonly record struct StreamingWorkMeterSnapshot(
|
|||
int OversizedProgressCount,
|
||||
int FailureCount,
|
||||
double ElapsedMilliseconds,
|
||||
double MaximumOperationMilliseconds,
|
||||
string? MaximumOperationStage,
|
||||
string? LastStage,
|
||||
StreamingWorkLimit LastLimit);
|
||||
|
||||
|
|
@ -163,6 +165,12 @@ public readonly record struct StreamingWorkMeterSnapshot(
|
|||
/// </summary>
|
||||
public readonly record struct StreamingWorkDiagnostics(
|
||||
StreamingWorkMeterSnapshot LastFrame,
|
||||
long LifetimeFrameOverrunCount,
|
||||
long LifetimeOversizedProgressCount,
|
||||
double MaximumFrameMilliseconds,
|
||||
string? MaximumFrameStage,
|
||||
double MaximumOperationMilliseconds,
|
||||
string? MaximumOperationStage,
|
||||
int DeferredCompletions,
|
||||
long DeferredAdoptedCpuBytes,
|
||||
double OldestDeferredAgeMilliseconds,
|
||||
|
|
@ -193,6 +201,8 @@ public sealed class StreamingWorkMeter
|
|||
private long _destinationElapsedTicks;
|
||||
private long _nonDestinationElapsedTicks;
|
||||
private long _activeOperationStart;
|
||||
private double _maximumOperationMilliseconds;
|
||||
private string? _maximumOperationStage;
|
||||
private int _operations;
|
||||
private int _completed;
|
||||
private int _yields;
|
||||
|
|
@ -303,8 +313,8 @@ public sealed class StreamingWorkMeter
|
|||
CompleteLaneTiming();
|
||||
_completed++;
|
||||
_reservationActive = false;
|
||||
_activeStage = null;
|
||||
ObserveElapsedOverrun();
|
||||
_activeStage = null;
|
||||
}
|
||||
|
||||
public void Fail()
|
||||
|
|
@ -313,8 +323,8 @@ public sealed class StreamingWorkMeter
|
|||
CompleteLaneTiming();
|
||||
_failures++;
|
||||
_reservationActive = false;
|
||||
_activeStage = null;
|
||||
ObserveElapsedOverrun();
|
||||
_activeStage = null;
|
||||
}
|
||||
|
||||
public void FinishFrame()
|
||||
|
|
@ -341,6 +351,8 @@ public sealed class StreamingWorkMeter
|
|||
_oversizedProgress,
|
||||
_failures,
|
||||
ElapsedMilliseconds(now),
|
||||
_maximumOperationMilliseconds,
|
||||
_maximumOperationStage,
|
||||
_lastStage,
|
||||
_lastLimit);
|
||||
}
|
||||
|
|
@ -428,6 +440,13 @@ public sealed class StreamingWorkMeter
|
|||
private void CompleteLaneTiming()
|
||||
{
|
||||
long raw = Math.Max(0L, _timestamp() - _activeOperationStart);
|
||||
double elapsedMilliseconds = raw * 1000.0 / _frequency;
|
||||
if (_maximumOperationStage is null
|
||||
|| elapsedMilliseconds > _maximumOperationMilliseconds)
|
||||
{
|
||||
_maximumOperationMilliseconds = elapsedMilliseconds;
|
||||
_maximumOperationStage = _activeStage;
|
||||
}
|
||||
long elapsed = raw > long.MaxValue / TimeSpan.TicksPerSecond
|
||||
? long.MaxValue
|
||||
: raw * TimeSpan.TicksPerSecond / _frequency;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue