-
Notifications
You must be signed in to change notification settings - Fork 2
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
Use None rather than 0 prior to measurement #135
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #135 +/- ##
==========================================
+ Coverage 94.33% 94.65% +0.31%
==========================================
Files 2 2
Lines 353 374 +21
Branches 57 60 +3
==========================================
+ Hits 333 354 +21
Misses 14 14
Partials 6 6 ☔ View full report in Codecov by Sentry. |
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.
two notes and one question (which might need a unittest being added)
assert other.total_rss is not None | ||
assert other.total_vsz is not None | ||
assert other.total_pmem is not None | ||
assert other.total_pcpu is not None |
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.
just a note since not relevant to this PR: I have odd feeling here about code that this self
is having assumptions about other
(Sample)
self.rss += (other.total_rss - self.rss) / self.num_samples | ||
self.vsz += (other.total_vsz - self.vsz) / self.num_samples | ||
self.pmem += (other.total_pmem - self.pmem) / self.num_samples | ||
self.pcpu += (other.total_pcpu - self.pcpu) / self.num_samples |
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.
just another note: I feel odd about this math here... unrelated to this PR though, so just a note.
If we have not measured, 0 is incorrect.
9781b7e
to
3e22d23
Compare
Fixes #133
If we have not measured, 0 is incorrect.
We also substitute
unknown
for None when printing for the user