Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(performance-metrics): system resource tracker configuration (#15598
) # Overview Adds the ability to configure the behavior of the system resource tracker monitoring script through environment variables. Closes [EXEC-597](https://opentrons.atlassian.net/browse/EXEC-597) # Test Plan - [x] Pull this branch - [x] Go to `performance-metrics` project - [x] Run `make teardown && make setup` to ensure python env is up to date - [x] Ensure performance metrics ff is enabled by running `make set-performance-metrics-ff host=<robot_ip>` - [x] Push changes to Flex or Dev Kit by running ` make setup-remote-flex host=10.10.10.151 ssh_key=~/.ssh/flex_ssh_key` - [ ] ssh to the robot - [x] Wipe any existing performance metrics data `rm -fr /data/performance_metrics_data` - [x] Go to `/opt/opentrons-robot-server` - [x] Run `python3 -m performance_metrics.system_resource_tracker` - [x] Verify you get a log message that looks like the following ``` 2024-07-09 14:31:40,347 - __main__ - main() - INFO - Running with the following configuration: enabled=False process_filters=('/opt/opentrons*', 'python3*') refresh_interval=10.0 storage_dir=/data/performance_metrics_data logging_level=INFO ``` - [x] Kill the process with CTRL + C - [ ] Ensure that system resources are captured by looking at system_resource_tracker files in /data/performance_metrics - [ ] Run `OT_SYSTEM_RESOURCE_TRACKER_REFRESH_INTERVAL=15.0 OT_SYSTEM_RESOURCE_TRACKER_LOGGING_LEVEL=DEBUG python3 -m performance_metrics.system_resource_tracker` - [ ] Verify the initial log message about the configuration has changed to something like: ``` 2024-07-09 14:31:40,347 - __main__ - main() - INFO - Running with the following configuration: enabled=False process_filters=('/opt/opentrons*', 'python3*') refresh_interval=15.0 storage_dir=/data/performance_metrics_data logging_level=DEBUG ``` - [ ] Verify you are now getting a ton more log messages but less frequently - [ ] Kill the process with CTRL + C - [ ] Ensure that more system resources captures have been added by looking at system_resource_tracker files in /data/performance_metrics # Changelog - Add make targets to assist in setting up performance-metrics on robot - Add `performance_metrics.system_resource_tracker._config` containing SystemResourceTrackerConfiguration class which has all values that can be configured for the SystemResourceTracker - Update SystemResourceTracker to use SystemResourceTrackerConfiguration - Add pulling config from environment variables and using it in __main__.py - Add logging for debugging purposes - Add tests # Review requests I configured all the performance metrics loggers to use the same name so I can update the log level of all of them inside of main. Is this the correct way to ensure all of them get updated? Or is there a better way # Risk assessment Low [EXEC-597]: https://opentrons.atlassian.net/browse/EXEC-597?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
- Loading branch information