mirror of
https://github.com/YspCoder/clawgo.git
synced 2026-05-18 14:57:37 +08:00
expose gateway autonomy in CLI help and add autonomy action ratios
This commit is contained in:
@@ -177,12 +177,20 @@ func summarizeAutonomyActions(statsJSON []byte) string {
|
||||
return ""
|
||||
}
|
||||
keys := []string{"autonomy:dispatch", "autonomy:waiting", "autonomy:resume", "autonomy:blocked", "autonomy:complete"}
|
||||
parts := make([]string, 0, len(keys))
|
||||
parts := make([]string, 0, len(keys)+1)
|
||||
total := 0
|
||||
for _, k := range keys {
|
||||
if v, ok := payload.Counts[k]; ok {
|
||||
parts = append(parts, fmt.Sprintf("%s=%d", strings.TrimPrefix(k, "autonomy:"), v))
|
||||
total += v
|
||||
}
|
||||
}
|
||||
if total > 0 {
|
||||
d := payload.Counts["autonomy:dispatch"]
|
||||
w := payload.Counts["autonomy:waiting"]
|
||||
b := payload.Counts["autonomy:blocked"]
|
||||
parts = append(parts, fmt.Sprintf("ratios(dispatch/waiting/blocked)=%.2f/%.2f/%.2f", float64(d)/float64(total), float64(w)/float64(total), float64(b)/float64(total)))
|
||||
}
|
||||
return strings.Join(parts, " ")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user