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. |
||
|---|---|---|
| .. | ||
| mocks | ||
| api-integration.test.ts | ||
| auto-configuration.test.ts | ||
| core.test.ts | ||
| database-operations.test.ts | ||
| dimension-standardization.test.ts | ||
| distributed-caching.test.ts | ||
| distributed-config-migration.test.ts | ||
| distributed.test.ts | ||
| edge-cases.test.ts | ||
| environment.browser.test.ts | ||
| environment.node.test.ts | ||
| error-handling.test.ts | ||
| frozen-flag.test.ts | ||
| json-search-test.js | ||
| multi-environment.test.ts | ||
| opfs-storage.test.ts | ||
| package-install.test.ts | ||
| package-size-breakdown.test.ts | ||
| package-size-limit.test.ts | ||
| pagination.test.ts | ||
| performance-improvements.test.ts | ||
| performance.test.ts | ||
| s3-storage.test.ts | ||
| service-statistics.test.ts | ||
| setup.ts | ||
| specialized-scenarios.test.ts | ||
| statistics-storage.test.ts | ||
| statistics.test.ts | ||
| storage-adapter-coverage.test.ts | ||
| storage-adapters.test.ts | ||
| test-matrix.md | ||
| type-utils.test.ts | ||
| vector-operations.test.ts | ||
| verify-custom-models.js | ||
| verify-model-loading.js | ||
| verify-model-priority-simple.js | ||