Skip to content
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

Merged
merged 4 commits into from
Aug 14, 2024

Conversation

asmacdo
Copy link
Member

@asmacdo asmacdo commented Aug 14, 2024

Fixes #133

If we have not measured, 0 is incorrect.

We also substitute unknown for None when printing for the user

Copy link

codecov bot commented Aug 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.65%. Comparing base (fc355ea) to head (3e22d23).
Report is 5 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

Copy link
Member

@yarikoptic yarikoptic left a 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
Copy link
Member

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
Copy link
Member

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.

@asmacdo asmacdo force-pushed the none-when-unknown branch from 9781b7e to 3e22d23 Compare August 14, 2024 19:59
@yarikoptic yarikoptic merged commit 3786274 into con:main Aug 14, 2024
30 checks passed
@asmacdo asmacdo added the semver-minor Increment the minor version when merged label Aug 14, 2024
@asmacdo asmacdo deleted the none-when-unknown branch August 22, 2024 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver-minor Increment the minor version when merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace ad-hoc "unknown" string in records with numbers to None
2 participants