mirror of
https://github.com/YspCoder/clawgo.git
synced 2026-05-18 02:27:30 +08:00
track autonomy action-level counts in trigger stats
This commit is contained in:
@@ -448,6 +448,10 @@ func (e *Engine) writeTriggerAudit(action string, st *taskState, errText string)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
stats.Counts["autonomy"]++
|
stats.Counts["autonomy"]++
|
||||||
|
act := strings.ToLower(strings.TrimSpace(action))
|
||||||
|
if act != "" {
|
||||||
|
stats.Counts["autonomy:"+act]++
|
||||||
|
}
|
||||||
stats.UpdatedAt = time.Now().UTC().Format(time.RFC3339)
|
stats.UpdatedAt = time.Now().UTC().Format(time.RFC3339)
|
||||||
if raw, mErr := json.MarshalIndent(stats, "", " "); mErr == nil {
|
if raw, mErr := json.MarshalIndent(stats, "", " "); mErr == nil {
|
||||||
_ = os.WriteFile(statsPath, raw, 0644)
|
_ = os.WriteFile(statsPath, raw, 0644)
|
||||||
|
|||||||
Reference in New Issue
Block a user