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

FlatlineRule: Extract functions that could be overriden by child classes #1291

Merged
merged 4 commits into from
Oct 13, 2023

Conversation

rundef
Copy link

@rundef rundef commented Oct 12, 2023

Description

In a project, I created a class extending FlatlineRule and added some custom code.
However, I had to copy the code of check_for_match and garbage_function in the children class just to change a few lines of code, which isn't great.

This PR adds:

  • a get_threshold function (users will be able to override that function in case the threshold changes depending on the key).
  • a get_keys function (in my case I'm retrieving the keys from an external API)
  • a get_event_data function (to add custom variable for alerts)

Checklist

  • I have reviewed the contributing guidelines.
  • I have included unit tests for my changes or additions.
  • I have successfully run make test-docker with my changes.
  • I have manually tested all relevant modes of the change in this PR.
  • I have updated the documentation.
  • I have updated the changelog.

Questions or Comments

I did not add any unit tests because there isn't any new feature.
I did not update the documentation because there's no section about extending rules.

Sorry, something went wrong.

mburguet and others added 3 commits October 12, 2023 10:39

Verified

This commit was signed with the committer’s verified signature.
markov00 Marco Vettorello
jertel
jertel previously approved these changes Oct 13, 2023
Copy link
Owner

@jertel jertel left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution!

@jertel jertel merged commit 8e8fe69 into jertel:master Oct 13, 2023
1 check passed
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants