brainy/src
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
..
augmentations refactor: simplify build system and improve model loading flexibility 2025-08-05 16:09:30 -07:00
distributed feat: migrate system metadata from 'index' to '_system' directory with backward compatibility 2025-08-06 09:45:56 -07:00
errors **feat: implement robust error-handling and operation utilities for storage adapters** 2025-07-30 11:35:09 -07:00
examples refactor: clean up deprecated functions and unused code 2025-08-05 10:16:05 -07:00
hnsw feat: add GPU acceleration for embeddings with smart device auto-detection 2025-08-05 20:00:04 -07:00
mcp **docs: update README to streamline server functionality documentation** 2025-07-15 11:51:27 -07:00
storage feat: add comprehensive per-service statistics tracking 2025-08-06 10:17:28 -07:00
types feat\!: migrate from TensorFlow.js to Transformers.js with ONNX Runtime 2025-08-05 19:29:59 -07:00
utils feat: add GPU acceleration for embeddings with smart device auto-detection 2025-08-05 20:00:04 -07:00
augmentationFactory.ts Initial commit 2025-06-24 11:41:30 -07:00
augmentationPipeline.ts fix(src/augmentationPipeline): remove unnecessary whitespace for formatting consistency 2025-06-30 09:39:25 -07:00
augmentationRegistry.ts Initial commit 2025-06-24 11:41:30 -07:00
augmentationRegistryLoader.ts Initial commit 2025-06-24 11:41:30 -07:00
brainyData.ts feat: add comprehensive per-service statistics tracking 2025-08-06 10:17:28 -07:00
browserFramework.ts refactor: simplify build system and improve model loading flexibility 2025-08-05 16:09:30 -07:00
coreTypes.ts feat: add comprehensive per-service statistics tracking 2025-08-06 10:17:28 -07:00
demo.ts feat\!: migrate from TensorFlow.js to Transformers.js with ONNX Runtime 2025-08-05 19:29:59 -07:00
index.ts feat\!: migrate from TensorFlow.js to Transformers.js with ONNX Runtime 2025-08-05 19:29:59 -07:00
pipeline.ts Initial commit 2025-06-24 11:41:30 -07:00
sequentialPipeline.ts Initial commit 2025-06-24 11:41:30 -07:00
setup.ts feat\!: migrate from TensorFlow.js to Transformers.js with ONNX Runtime 2025-08-05 19:29:59 -07:00
unified.ts **docs: remove outdated statistics-related documentation and add standards** 2025-07-28 16:00:05 -07:00
worker.js **feat(cli, workers): introduce text encoding patches and worker improvements** 2025-07-04 14:42:33 -07:00
worker.ts **feat(tests): add tests for TextEncoder, TensorFlow.js, and fallback mechanisms** 2025-07-11 11:11:56 -07:00