pool_stats
Monitor SSH connection pool statistics to track active sessions, available connections, and resource usage for remote server management.
Instructions
Affiche les statistiques du pool de connexions SSH persistantes.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- server.js:617-628 (registration)Registers the MCP tool 'pool_stats' with empty input schema and an inline handler that calls ssh.getPoolStats() to retrieve and format pool statistics.server.registerTool( "pool_stats", { title: "Statistiques du pool de connexions SSH", description: "Affiche les statistiques du pool de connexions SSH persistantes.", inputSchema: z.object({}) }, async () => { const stats = ssh.getPoolStats(); return { content: [{ type: "text", text: `Pool de connexions SSH:\n${JSON.stringify(stats, null, 2)}` }] }; } );
- ssh.js:364-366 (helper)Helper function getPoolStats() in ssh.js that delegates to the SSH pool's getStats() method.function getPoolStats() { return sshPool.getStats(); }
- sshPool.js:223-249 (handler)Core handler logic in SSHConnectionPool.getStats(): computes detailed statistics including total connections and per-server breakdown with usage status.getStats() { const stats = { totalConnections: this.activeConnections.size, byServer: {} }; for (const [serverAlias, pool] of this.pools) { const connections = pool.map(connId => { const info = this.activeConnections.get(connId); return { id: connId, inUse: info?.inUse || false, ready: info?.conn?.isReady || false, lastUsed: info?.lastUsed }; }); stats.byServer[serverAlias] = { total: connections.length, inUse: connections.filter(c => c.inUse).length, available: connections.filter(c => !c.inUse && c.ready).length, connections }; } return stats; }