MCPcopy
hub / github.com/BlockRunAI/ClawRouter / getStats

Method getStats

src/session.ts:165–173  ·  view source on GitHub ↗

* Get session stats for debugging.

()

Source from the content-addressed store, hash-verified

163 * Get session stats for debugging.
164 */
165 getStats(): { count: number; sessions: Array<{ id: string; model: string; age: number }> } {
166 const now = Date.now();
167 const sessions = Array.from(this.sessions.entries()).map(([id, entry]) => ({
168 id: id.slice(0, 8) + "...",
169 model: entry.model,
170 age: Math.round((now - entry.createdAt) / 1000),
171 }));
172 return { count: this.sessions.size, sessions };
173 }
174
175 /**
176 * Clean up expired sessions.

Calls

no outgoing calls

Tested by

no test coverage detected