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

[Prometheus Emitter] Add to code coverage and remove code smell #17362

Merged
merged 3 commits into from
Oct 17, 2024

Conversation

ashwintumma23
Copy link
Contributor

Description

Added code coverage ...

  • Additions to cover the error and exception cases for Prometheus emitter's metrics

Fixed a code smell ...

  • Same variable name, registeredMetrics was being used for Class variable name as well as local variable where configs are being parsed
  • Renamed the local variable to parsedRegisteredMetrics to reflect the local map's purpose.
  • Why was marked as a Code smell?
    • Shadowing the variable in outer scope impacted readability, and hence the maintainability of that specific block of code

Key changed/added classes in this PR
  • Metrics
  • MetricsTest

This PR has:

  • been self-reviewed.
  • added documentation for new or modified features or behaviors.
  • a release note entry in the PR description.
  • added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
  • added or updated version, license, or notice information in licenses.yaml
  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met.
  • added integration tests.
  • been tested in a test Druid cluster.

@ashwintumma23 ashwintumma23 changed the title Prom metrics coverage [Prometheus Emitter] Add to code coverage and remove code smell Oct 16, 2024
Copy link
Contributor

@cryptoe cryptoe left a comment

Choose a reason for hiding this comment

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

Thank you for the contribution @ashwintumma23 🚀

@cryptoe cryptoe merged commit 90175b8 into apache:master Oct 17, 2024
56 checks passed
@ashwintumma23 ashwintumma23 deleted the promMetricsCoverage branch October 17, 2024 14:05
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