Open
Conversation
Adds psutil-based resource monitoring to ModuleCoordinator.loop(), collecting CPU, memory (PSS/USS/RSS/VMS), threads, children, FDs, and IO stats per worker process every 2s. Stats are published over LCM and viewable with the new `dtop` CLI tool. - WorkerStats dataclass and collect_stats() on Worker/WorkerManager - ResourceLogger protocol with LCM and structlog implementations - dtop: live Textual TUI subscribing to /dimos/resource_stats - psutil added as explicit dependency - Bump smart blueprint to 7 workers
Cache psutil.Process objects across snapshots so cpu_percent(interval=None) has a previous sample to diff against. Fix wrong module name in docstring, remove dead _snap_count state, and extend color gradient to cyan→yellow→red.
dimos/core/module_coordinator.py
Outdated
| resource_logger: ResourceLogger | None = None, | ||
| monitor_interval: float = 1.0, | ||
| ) -> None: | ||
| _logger: ResourceLogger = resource_logger or LCMResourceLogger() |
Contributor
There was a problem hiding this comment.
I think we should have a flag to only gather statistics if it was requested.
Contributor
Author
|
I think |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Obsoleting dask, we didn't know the resource use of modules
Misc
Solution
ModuleCoordinator.loop(), collecting system stats, pluggable publishers (structlog, lcm)/dimos/resource_statsdtopCLI tool capturing the LCM topicTODO
this (with diff stats output - maybe on exit one) can now be used for profiling tests, and comparing to dev!
Breaking Changes
None
How to Test
run some blueprint
Contributor License Agreement