pool_stats
View statistics for persistent SSH connection pools to monitor active sessions, usage patterns, and connection health within the SFTP orchestration system.
Instructions
Affiche les statistiques du pool de connexions SSH persistantes.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- server.js:624-627 (handler)MCP tool handler for 'pool_stats': calls ssh.getPoolStats() and returns formatted statistics as text content.async () => { const stats = ssh.getPoolStats(); return { content: [{ type: "text", text: `Pool de connexions SSH:\n${JSON.stringify(stats, null, 2)}` }] }; }
- server.js:619-623 (schema)Tool specification including title, description, and empty input schema (z.object({})).{ title: "Statistiques du pool de connexions SSH", description: "Affiche les statistiques du pool de connexions SSH persistantes.", inputSchema: z.object({}) },
- server.js:617-628 (registration)Registration of the 'pool_stats' MCP tool, including schema and inline handler.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:363-366 (helper)Helper function getPoolStats() exported from ssh.js, acting as a wrapper to sshPool.getStats().// Obtenir les stats du pool function getPoolStats() { return sshPool.getStats(); }
- sshPool.js:222-249 (helper)Core implementation of getStats() in SSHConnectionPool class, computing detailed statistics on connections by server.// Obtenir les statistiques du pool 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; }