Add full support for tracking and analyzing data by service in multi-tenant deployments. ## Features Added - **Service Statistics Tracking**: Track nouns, verbs, and metadata counts per service - **Service Activity Monitoring**: Track first/last activity timestamps and operation counts - **New API Methods**: - `listServices()`: List all services with their statistics and status - `getServiceStatistics(service)`: Get detailed stats for a specific service - Enhanced `getStatistics()` with service filtering and breakdown - **Service Filtering**: Filter search results and queries by service - **Storage Enhancements**: BaseStorageAdapter tracks service activity with timestamps - **Type Definitions**: Added ServiceStatistics interface and extended StatisticsData ## Implementation Details - Services automatically tracked via defaultService config or per-operation override - Service status detection (active/inactive/read-only) based on activity - Memory-efficient tracking at statistics level, not per noun/verb - Backward compatible - existing data tracked under 'default' service ## Documentation - Comprehensive guide in docs/guides/per-service-statistics.md - Examples for multi-tenant apps, health monitoring, and auditing - API reference and migration guide included ## Testing - Full test suite in tests/service-statistics.test.ts - Coverage of all new methods and filtering capabilities This enables better observability, debugging, and management of multi-service Brainy deployments, addressing the need to track individual service performance when multiple services share storage. |
||
|---|---|---|
| .. | ||
| cache-configuration.md | ||
| hnsw-field-search.md | ||
| json-document-search.md | ||
| model-management.md | ||
| offline-model-reliability.md | ||
| optional-model-bundling.md | ||
| per-service-statistics.md | ||
| production-migration-guide.md | ||
| readonly-frozen-modes.md | ||
| service-identification.md | ||