Curtailment: report curtailed percent instead of bool (#32010)

This commit is contained in:
andig 2026-07-21 13:14:40 +02:00 • committed by GitHub
parent 435ed72a56
commit 608aa36629
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 178 additions and 56 deletions

View file

@ -441,8 +441,9 @@ func testInstance(ctx context.Context, instance any) map[string]testResult {
wg.Go(func() {
if dev, ok := api.Cap[api.Curtailer](instance); ok {
makeResult("curtailable", true, nil)
if val, err := dev.Curtailed(); err != nil || val {
makeResult("curtailed", true, err)
// only reported while actually curtailing
if val, err := dev.CurtailedPercent(); err != nil || val < 100 {
makeResult("curtailed", val, err)
}
}
})