brainy/docs/guides
David Snelling d2ddb9199e feat: add comprehensive per-service statistics tracking
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.
2025-08-06 10:17:28 -07:00
..
cache-configuration.md **feat(docs): add comprehensive cache configuration guide and enhance adaptive tuning** 2025-08-01 11:47:34 -07:00
hnsw-field-search.md **feat(search): enhance JSON document search with field-level filtering and prioritization** 2025-08-01 08:27:39 -07:00
json-document-search.md **feat(search): enhance JSON document search with field-level filtering and prioritization** 2025-08-01 08:27:39 -07:00
model-management.md **feat(brainy-models): implement robust format field validation and update workflow scripts** 2025-08-01 18:00:36 -07:00
offline-model-reliability.md feat(reliability): implement automatic offline model detection for production 2025-08-05 09:32:15 -07:00
optional-model-bundling.md **feat(docs): add comprehensive documentation for model bundling and robust loading** 2025-08-01 15:35:29 -07:00
per-service-statistics.md feat: add comprehensive per-service statistics tracking 2025-08-06 10:17:28 -07:00
production-migration-guide.md **chore: remove outdated changelog and summary documents** 2025-07-30 11:51:39 -07:00
readonly-frozen-modes.md feat: add frozen flag for complete immutability and simplify README examples 2025-08-06 09:52:45 -07:00
service-identification.md **docs(guides): add service identification guide** 2025-08-01 10:16:18 -07:00