| 1 | package persistentshell |
| 2 | |
| 3 | import "sync/atomic" |
| 4 | |
| 5 | type shellMetrics struct { |
| 6 | started atomic.Uint64 |
| 7 | startupFailed atomic.Uint64 |
| 8 | completionMissing atomic.Uint64 |
| 9 | timedOut atomic.Uint64 |
| 10 | reset atomic.Uint64 |
| 11 | } |
| 12 | |
| 13 | // Diagnostics is bounded process-local telemetry, with no commands or environment. |
| 14 | func (m *Manager) Diagnostics() map[string]uint64 { |
| 15 | if m == nil { |
| 16 | return nil |
| 17 | } |
| 18 | return map[string]uint64{"started": m.metrics.started.Load(), "startupFailed": m.metrics.startupFailed.Load(), |
| 19 | "completionMissing": m.metrics.completionMissing.Load(), "timedOut": m.metrics.timedOut.Load(), "reset": m.metrics.reset.Load()} |
| 20 | } |
| 21 |