brainy/tests
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
..
mocks feat(tests): add robust mock implementations and expand test coverage for S3 and OPFS storage 2025-07-21 13:42:10 -07:00
api-integration.test.ts **test(storage-adapter-coverage): improve search result validation and consistency in assertions** 2025-08-01 18:31:05 -07:00
auto-configuration.test.ts feat(pagination): implement cursor-based pagination and enhance search caching 2025-08-04 14:25:05 -07:00
core.test.ts feat: migrate system metadata from 'index' to '_system' directory with backward compatibility 2025-08-06 09:45:56 -07:00
database-operations.test.ts **docs: remove outdated statistics-related documentation and add standards** 2025-07-28 16:00:05 -07:00
dimension-standardization.test.ts fix: resolve test failures and browser environment issues 2025-08-05 19:38:26 -07:00
distributed-caching.test.ts feat(pagination): implement cursor-based pagination and enhance search caching 2025-08-04 14:25:05 -07:00
distributed-config-migration.test.ts feat: migrate system metadata from 'index' to '_system' directory with backward compatibility 2025-08-06 09:45:56 -07:00
distributed.test.ts feat\!: migrate from TensorFlow.js to Transformers.js with ONNX Runtime 2025-08-05 19:29:59 -07:00
edge-cases.test.ts feat\!: migrate from TensorFlow.js to Transformers.js with ONNX Runtime 2025-08-05 19:29:59 -07:00
environment.browser.test.ts fix: resolve test failures and browser environment issues 2025-08-05 19:38:26 -07:00
environment.node.test.ts feat\!: migrate from TensorFlow.js to Transformers.js with ONNX Runtime 2025-08-05 19:29:59 -07:00
error-handling.test.ts **docs: remove outdated statistics-related documentation and add standards** 2025-07-28 16:00:05 -07:00
frozen-flag.test.ts feat: add frozen flag for complete immutability and simplify README examples 2025-08-06 09:52:45 -07:00
json-search-test.js **feat(search): enhance JSON document search with field-level filtering and prioritization** 2025-08-01 08:27:39 -07:00
multi-environment.test.ts **feat(scripts): add automated release workflow script** 2025-07-31 13:40:28 -07:00
opfs-storage.test.ts **feat(core, storage, tests): enhance verb construction with timestamps and metadata** 2025-07-25 09:44:10 -07:00
package-install.test.ts refactor: simplify build system and improve model loading flexibility 2025-08-05 16:09:30 -07:00
package-size-breakdown.test.ts feat(tests): replace old test scripts with updated test suite for storage and reporting 2025-07-21 12:47:20 -07:00
package-size-limit.test.ts fix: include all JavaScript modules in npm package 2025-08-05 16:20:36 -07:00
pagination.test.ts feat\!: migrate from TensorFlow.js to Transformers.js with ONNX Runtime 2025-08-05 19:29:59 -07:00
performance-improvements.test.ts feat(pagination): implement cursor-based pagination and enhance search caching 2025-08-04 14:25:05 -07:00
performance.test.ts **docs: remove outdated statistics-related documentation and add standards** 2025-07-28 16:00:05 -07:00
s3-storage.test.ts **test(storage): add tests for S3 change log functionality** 2025-07-31 10:22:47 -07:00
service-statistics.test.ts feat: add comprehensive per-service statistics tracking 2025-08-06 10:17:28 -07:00
setup.ts feat\!: migrate from TensorFlow.js to Transformers.js with ONNX Runtime 2025-08-05 19:29:59 -07:00
specialized-scenarios.test.ts **fix(storage): improve restoration and deletion logic in storage adapter** 2025-07-31 14:03:51 -07:00
statistics-storage.test.ts **feat(tests, docs, storage): add statistics storage tests and enhance documentation** 2025-07-24 16:24:02 -07:00
statistics.test.ts feat\!: migrate from TensorFlow.js to Transformers.js with ONNX Runtime 2025-08-05 19:29:59 -07:00
storage-adapter-coverage.test.ts **test(storage-adapter-coverage): improve search result validation and consistency in assertions** 2025-08-01 18:31:05 -07:00
storage-adapters.test.ts refactor: simplify build system and improve model loading flexibility 2025-08-05 16:09:30 -07:00
test-matrix.md **docs: remove outdated statistics-related documentation and add standards** 2025-07-28 16:00:05 -07:00
type-utils.test.ts **feat(utils): add type utility functions and examples for runtime type management** 2025-07-31 14:24:16 -07:00
vector-operations.test.ts fix: resolve test failures and browser environment issues 2025-08-05 19:38:26 -07:00
verify-custom-models.js refactor: simplify build system and improve model loading flexibility 2025-08-05 16:09:30 -07:00
verify-model-loading.js refactor: simplify build system and improve model loading flexibility 2025-08-05 16:09:30 -07:00
verify-model-priority-simple.js refactor: simplify build system and improve model loading flexibility 2025-08-05 16:09:30 -07:00