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

[procdockerstatsd] add missing unit conversion #7151

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

pra-moh
Copy link
Contributor

@pra-moh pra-moh commented Mar 25, 2021

Why I did it

Observed state_db contains 'None' as value for BLOCK_OUT_BYTES
"227a593e011f":{"BLOCK_IN_BYTES":"107000000","BLOCK_OUT_BYTES":"None","CPU%":"0.68","MEM%":"2.37","MEM_BYTES":"1983905792","MEM_LIMIT_BYTES":"8359080099840","NAME":"bgp","NET_IN_BYTES":"0","NET_OUT_BYTES":"0","PIDS":"21"

For BGP docker Block O is in GB and script is missing this conversion
image

How I did it

How to verify it

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012

Description for the changelog

A picture of a cute animal (not mandatory but encouraged)

jleveque
jleveque previously approved these changes Mar 25, 2021
@hui-ma hui-ma self-requested a review March 25, 2021 23:15
hui-ma
hui-ma previously approved these changes Mar 25, 2021
lguohan pushed a commit that referenced this pull request Mar 26, 2021
Fixing same issue in 201911 as mention here #7151
Copy link
Collaborator

@lguohan lguohan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add unit tests

@jleveque
Copy link
Contributor

@pra-moh pra-moh dismissed stale reviews from hui-ma and jleveque via 8ccd565 March 31, 2021 17:07
jleveque
jleveque previously approved these changes Mar 31, 2021
('7.751GiB', 8322572878),
('8.1TiB', 8906044184986),
('12TB', 12000000000000),
('2.25TB', 2250000000000)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the test is too simple, we need to have a test that convert from the ps -e output and test the content in the database as end-to-end test.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this test is appropriate to the convert_to_bytes() method. More test cases need to be added in order to ensure full end-to-end functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants