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

Add util to load jmx metric configs #3162

Merged
merged 2 commits into from
Feb 20, 2019
Merged

Add util to load jmx metric configs #3162

merged 2 commits into from
Feb 20, 2019

Conversation

ofek
Copy link
Contributor

@ofek ofek commented Feb 19, 2019

Motivation

Support e2e for jmx checks soon

Note: PyYAML is now a test dep instead

@codecov
Copy link

codecov bot commented Feb 19, 2019

Codecov Report

Merging #3162 into master will decrease coverage by 3.43%.
The diff coverage is 21.42%.

@@            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)
Copy link
Collaborator

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?

Copy link
Contributor Author

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

Copy link
Collaborator

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 {}
Copy link
Collaborator

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.

Copy link
Collaborator

@nmuesch nmuesch left a comment

Choose a reason for hiding this comment

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

Looks solid. Thanks!

@ofek ofek merged commit 8a01fac into master Feb 20, 2019
@ofek ofek deleted the ofek/jmx branch February 20, 2019 15:54
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.

2 participants