feat(server): add threads count and disk space to sysinfo stats#2917
Open
seokjin0414 wants to merge 6 commits intoapache:masterfrom
Open
feat(server): add threads count and disk space to sysinfo stats#2917seokjin0414 wants to merge 6 commits intoapache:masterfrom
seokjin0414 wants to merge 6 commits intoapache:masterfrom
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #2917 +/- ##
============================================
- Coverage 70.27% 70.26% -0.01%
Complexity 862 862
============================================
Files 1029 1029
Lines 85283 85332 +49
Branches 62653 62715 +62
============================================
+ Hits 59932 59958 +26
- Misses 22839 22850 +11
- Partials 2512 2524 +12
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
hubcio
reviewed
Mar 11, 2026
hubcio
requested changes
Mar 15, 2026
Contributor
hubcio
left a comment
There was a problem hiding this comment.
in PR description you say Disks, yet in code I don't see this being used. also please fix my comment in stats.rs. other than that LGTM.
| .unwrap_or(0) | ||
| .into(); | ||
| stats.total_disk_space = fs2::total_space(&self.config.system.path) | ||
| .unwrap_or(0) |
Contributor
There was a problem hiding this comment.
please add warning print when it fails
Contributor
Author
There was a problem hiding this comment.
Thanks for the review~
Fixed both — added tracing::warn! on fs2 failure in stats.rs (28d5840) and updated PR description to reflect fs2 instead of Disks
Add threads_count, free_disk_space, and total_disk_space fields to the Stats struct. Collect thread count via sysinfo Process::tasks() API and disk space via sysinfo Disks API with longest-prefix mount point matching. Update binary protocol serialization/deserialization with backward-compatible decoding, CLI table/list output, sysinfo printer log format, and integration tests including message size verification. Closes apache#2732 Signed-off-by: seokjin0414 <sars21@hanmail.net> Signed-off-by: shin <sars21@hanmail.net>
Use numeric IDs from server responses instead of string identifiers for send_messages call to avoid partition_not_found race condition in multi-shard architecture. Signed-off-by: shin <sars21@hanmail.net>
…rics Replace sysinfo::Disks::new_with_refreshed_list() with fs2::available_space() and fs2::total_space() for significantly lower overhead. fs2 performs a single statvfs syscall per metric (~10μs) vs sysinfo scanning all mount points (~0.5ms). fs2 is already used in the server crate (logger.rs). Signed-off-by: shin <sars21@hanmail.net>
Use Partitioning::default() instead of partition_id(1) to avoid partition_not_found errors in multi-shard CI environments where partition metadata may not have propagated to all shards yet. Signed-off-by: shin <sars21@hanmail.net>
Signed-off-by: shin <sars21@hanmail.net>
Signed-off-by: seokjin0414 <sars21@hanmail.net> Signed-off-by: shin <sars21@hanmail.net>
7293835 to
28d5840
Compare
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.
Summary
Closes #2732.
threads_count,free_disk_space,total_disk_spacefields to Stats structProcess::tasks()API (Linux only, 0 on macOS)fs2crate (statvfssyscall) with warning log on failureIggyUsage(messages_size_bytes),Disk(free/total),Threads(conditional) to sysinfo log outputDesign
process.tasks().map(|t| t.len()).unwrap_or(0)— uses existingrefresh_processes()call, no additional sysinfo refresh needed. Conditional log output (skipped when 0, matching OpenFDs pattern)fs2::available_space()/fs2::total_space()— singlestatvfssyscall per metric (~10μs), already used inlogger.rs. Logs warning on failure instead of silently defaulting to 0messages_size_bytesfield (iggy metadata only, no sysinfo) — added to sysinfo log outputcache_metrics, decoded withcurrent_position + N <= payload.len()guards for backward compatibility