-
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
Add util to load jmx metric configs #3162
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3162 +/- ##
==========================================
- Coverage 84.61% 81.18% -3.44%
==========================================
Files 677 30 -647
Lines 36619 999 -35620
Branches 4319 85 -4234
==========================================
- Hits 30984 811 -30173
+ Misses 4373 158 -4215
+ Partials 1262 30 -1232 |
@@ -182,6 +183,24 @@ def get_here(): | |||
return get_parent_dir(inspect.currentframe().f_back.f_code.co_filename) | |||
|
|||
|
|||
def load_jmx_config(): | |||
root = get_parent_dir(inspect.currentframe().f_back.f_code.co_filename) |
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.
Could this use the new get_here method you made?
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.
No I think b/c that would get this location
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.
Ahh good point
|
||
new_root = os.path.dirname(root) | ||
if new_root == root: | ||
return {} |
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.
What do you think about raising an exception here? I think if you use this function and there is no metrics.yaml, that's a bug.
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.
Looks solid. Thanks!
Motivation
Support e2e for jmx checks soon
Note:
PyYAML
is now a test dep instead