toggl_cache_stats
Retrieve cache statistics and performance metrics to monitor Toggl Track integration efficiency and optimize data retrieval.
Instructions
Get cache statistics and performance metrics
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:793-809 (handler)The handler case for 'toggl_cache_stats' that retrieves cache statistics via cache.getStats(), computes the cache hit rate, adds cache_warmed status, and returns a formatted JSON text response.case 'toggl_cache_stats': { const stats = cache.getStats(); const hitRate = stats.hits + stats.misses > 0 ? Math.round((stats.hits / (stats.hits + stats.misses)) * 100) : 0; return { content: [{ type: 'text', text: JSON.stringify({ ...stats, hit_rate: `${hitRate}%`, cache_warmed: cacheWarmed }, null, 2) }] }; }
- src/index.ts:366-373 (registration)Tool registration entry in the tools array used for ListTools, defining name, description, and input schema (no required parameters).name: 'toggl_cache_stats', description: 'Get cache statistics and performance metrics', inputSchema: { type: 'object', properties: {}, required: [] }, },
- src/cache-manager.ts:397-409 (helper)CacheManager.getStats() method providing the core statistics (sizes of cached maps and hit/miss counts) that power the toggl_cache_stats tool.getStats(): CacheStats { return { workspaces: this.workspaces.size, projects: this.projects.size, clients: this.clients.size, tasks: this.tasks.size, users: this.users.size, tags: this.tags.size, hits: this.stats.hits, misses: this.stats.misses, lastReset: this.stats.lastReset }; }