-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Change value type of params in memory_checker #12797
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
renukamanavalan
approved these changes
Nov 22, 2022
ganglyu
reviewed
Nov 23, 2022
@@ -100,7 +100,7 @@ def check_memory_usage(events_handle, container_name, threshold_value): | |||
syslog.syslog(syslog.LOG_INFO, "[{}]: Memory usage ({} Bytes) is larger than the threshold ({} Bytes)!" | |||
.format(container_name, mem_usage_bytes, threshold_value)) | |||
# publish event | |||
publish_events(events_handle, container_name, mem_usage_bytes, threshold_value) | |||
publish_events(events_handle, container_name, str(mem_usage_bytes), str(threshold_value)) |
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.
Is it possible to use unit test to cover this case?
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.
Will be covered as part of sonic-mgmt integration test
ganglyu
approved these changes
Nov 24, 2022
StormLiangMS
pushed a commit
to StormLiangMS/sonic-buildimage
that referenced
this pull request
Dec 8, 2022
Fix error when calling events API, required value is string, passing float
StormLiangMS
pushed a commit
that referenced
this pull request
Dec 10, 2022
Fix error when calling events API, required value is string, passing float
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Why I did it
Fix error when calling events API, required value is string, passing float
How I did it
Change type of value from float to string
How to verify it
Manual test:
Nov 22 08:24:56.181145 str-s6000-on-4 INFO memory_checker: [telemetry]: Memory usage (20573061.12 Bytes) is larger than the threshold (200 Bytes)!
Nov 22 08:26:02.651165 str-s6000-on-4 INFO memory_checker: [telemetry]: Memory usage (20573061.12 Bytes) is larger than the threshold (200 Bytes)!
Nov 22 08:26:02.851088 str-s6000-on-4 NOTICE memory_checker: :- publish: EVENT_PUBLISHED: {"sonic-events-host:mem-threshold-exceeded":{"ctr_name":"telemetry","mem_usage":"20573061.12","threshold":"200","timestamp":"2022-11-22T08:26:02.850599Z"}}
Which release branch to backport (provide reason below if selected)
Description for the changelog
Ensure to add label/tag for the feature raised. example - PR#2174 under sonic-utilities repo. where, Generic Config and Update feature has been labelled as GCU.
Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)