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.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement default process & runtime metrics #61
Implement default process & runtime metrics #61
Changes from 18 commits
8097604
69ba436
ad29d87
24882ac
55970f5
e276789
ce0ab69
928d094
dde317d
9a975d1
c6b8fba
3a8bb45
027477f
ffda628
47cb74a
3f5de0e
286ab64
1b3be71
a072b5d
a044d14
00cc3b0
0cf0d17
3f98a8f
78dcb03
9ab2612
8ffec02
606163b
71e992f
85fd683
27bd191
5c82101
fa82705
ead6f1d
7193cef
a43cab2
3a6f1a1
9317fd1
2da692d
cbb8a02
9c95321
73baa5a
adacbf2
8e9b22f
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about we separate the function and the data? ie make
SystemMetrics
a simple struct that just carried the data (model object if you will) and introduce a protocolSystemMetricsReader
or we can even have that as a function:
typealias SystemMetricsReader = (Int) -> Result<SystemMetrics, Error>
this way we dont need all these optionals and can simplify the try/catch stuff below - imo if it fails than no data better than partial data
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reasoning for the optionals here is to always provide as much data as possible to users. For example, on Linux these metrics are retrieved in 3 parts. 1 of those parts could fail, but the other metrics will still be exposed.
Curious what your reasoning is for no data better than partial data. (IMO it's not partial data, just less data)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MrLotU I am interested to understand the failure scenarios. i.e if some of these files you are trying to read does not exist, things must be bad no?