RecordSessionStart increments session count and updates avg duration.
()
| 72 | |
| 73 | // RecordSessionStart increments session count and updates avg duration. |
| 74 | func (pd *PatternDetector) RecordSessionStart() { |
| 75 | pd.mu.Lock() |
| 76 | defer pd.mu.Unlock() |
| 77 | |
| 78 | pd.stats.SessionCount++ |
| 79 | pd.stats.LastSession = time.Now() |
| 80 | pd.persist() |
| 81 | } |
| 82 | |
| 83 | // RecordSessionEnd updates average session duration. |
| 84 | func (pd *PatternDetector) RecordSessionEnd(duration time.Duration) { |
no test coverage detected