Allow filtering container statistics#471
Merged
dcantah merged 1 commit intoapple:mainfrom Jan 13, 2026
Merged
Conversation
Member
Author
|
Ok, I changed my mind. I think the events should just come along the ride in the statistics call we already have. However, I think we should allow filtering what stats a user actually wants in the call too. I'll change this pr |
52629fd to
9635791
Compare
egernst
reviewed
Jan 13, 2026
Contributor
egernst
left a comment
There was a problem hiding this comment.
Claude input:
The proto defines GetMemoryEvents at SandboxContext.proto:50 and the server implements it at Server+GRPC.swift:1183-1211, but there's no client-side wrapper. VirtualMachineAgent.swift:97 only has containerStatistics, not getMemoryEvents.
Memory events are already retrievable via containerStatistics(categories: .memoryEvents), so this dedicated RPC may be redundant. Either:
- Add a client wrapper if the RPC is intended for direct use
- Remove it if the category filtering approach supersedes it
- Add a comment explaining future intent (e.g., streaming support mentioned in commit message)
It's possible a user doesn't want the full stats list, and only wants cpu/mem etc. This plumbs through the ability to filter to only what is requested. This, while we're already here, adds in memory.event output to the stats list. For that specifically, I think eventually we may want a streaming variant of this so you can get alerted of changes in the file immediately instead of polling/one off reads, but this is useful for now.
9635791 to
b2a9946
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.
It's possible a user doesn't want the full stats list, and only wants cpu/mem etc. This plumbs through the ability to filter to only what is requested. This, while we're already here, adds in memory.event output to the stats list. For that specifically, I think eventually we may want a streaming variant of this so you can get alerted of changes in the file immediately instead of polling/one off reads, but this is useful for now.