mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-04 12:07:09 +00:00
feat(analyze): time an event at the step it was detected and report the quartiles
an obligation that never discharges is reported when the run ends, and timing it by the step that armed it recorded a liveness failure flushed at the budget as a violation found on step 1. the survival analysis now measures the detected step, falling back to the origin for campaigns written before the field existed, and says how many events that moved. the report gains the first and third quartiles beside the median.
This commit is contained in:
1 parent
a28178337c
commit
b99da0be0e
9 files changed
+354
-26
No files matched your search
@@ -20,7 +20,10 @@ type armSummary struct {
|
||||
ExcludedByReason map[string]int `json:"excluded_by_reason,omitempty"`
|
||||
MissingSeeds []int64 `json:"missing_seeds,omitempty"`
|
||||
EventsHeldAtBudget int `json:"events_held_at_budget"`
|
||||
EventsDetectedAfterOrigin int `json:"events_detected_after_origin"`
|
||||
MedianStepsToFirstViolation *float64 `json:"median_steps_to_first_violation"`
|
||||
FirstQuartileSteps *float64 `json:"first_quartile_steps_to_first_violation"`
|
||||
ThirdQuartileSteps *float64 `json:"third_quartile_steps_to_first_violation"`
|
||||
SurvivalCurve []survivalPoint `json:"survival_curve,omitempty"`
|
||||
ViolationRate *float64 `json:"violation_rate"`
|
||||
TotalSteps int `json:"total_steps"`
|
||||
@@ -154,6 +157,9 @@ func summarize(current arm) armSummary {
|
||||
if item.ClampedToBudget {
|
||||
summary.EventsHeldAtBudget++
|
||||
}
|
||||
if item.Violated && item.EventStep > item.OriginStep {
|
||||
summary.EventsDetectedAfterOrigin++
|
||||
}
|
||||
if item.Violated {
|
||||
summary.Violated++
|
||||
} else {
|
||||
@@ -170,6 +176,12 @@ func summarize(current arm) armSummary {
|
||||
if median, ok := medianSurvival(summary.SurvivalCurve); ok {
|
||||
summary.MedianStepsToFirstViolation = &median
|
||||
}
|
||||
if lower, ok := quantileSurvival(summary.SurvivalCurve, 0.25); ok {
|
||||
summary.FirstQuartileSteps = &lower
|
||||
}
|
||||
if upper, ok := quantileSurvival(summary.SurvivalCurve, 0.75); ok {
|
||||
summary.ThirdQuartileSteps = &upper
|
||||
}
|
||||
if summary.Usable > 0 {
|
||||
rate := float64(summary.Violated) / float64(summary.Usable)
|
||||
summary.ViolationRate = &rate
|
||||
|
||||
Reference in new issue
Block a user