-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
base: master
Are you sure you want to change the base?
Conversation
Fixing same issue in 201911 as mention here #7151
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.
please add unit tests
@pra-moh: Please enhance the existing test case to test the new units: https://github.com/Azure/sonic-buildimage/blob/master/src/sonic-host-services/tests/procdockerstatsd_test.py#L27 |
('7.751GiB', 8322572878), | ||
('8.1TiB', 8906044184986), | ||
('12TB', 12000000000000), | ||
('2.25TB', 2250000000000) |
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 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.
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.
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.
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
How I did it
How to verify it
Which release branch to backport (provide reason below if selected)
Description for the changelog
A picture of a cute animal (not mandatory but encouraged)