Skip to content

Conversation

@tharropoulos
Copy link
Contributor

Change Summary

Add metrics API support with tests and types

PR Checklist

- Create `MetricsResponse` types to handle API responses
- Add support for retrieving system metrics (CPU, memory, disk, network)
- Add support for Typesense-specific memory metrics
- Ensure compatibility with Python 3.11+ and earlier versions
- Add `Metrics` class with API integration
- Create method to retrieve system and Typesense metrics
- Define endpoint path for metrics retrieval
- Connect with existing `MetricsResponse` type
- Import `Metrics` class in `client.py`
- Add `metrics` attribute to `Client` class documentation
- Initialize `metrics` instance in `Client` constructor
- Update module documentation to reference metrics dependency
- Create `metrics_fixtures.py` with pytest fixture
- Set up fixture to return a `Metrics` object with actual API call
- Configure fixture with function scope for isolated testing
- Create `metrics_test.py` to test the `Metrics` class
- Implement test for the `retrieve()` method
- Verify all expected system metrics fields are p
@kishorenc kishorenc merged commit 1260829 into typesense:master Mar 31, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants