FlatlineRule: Extract functions that could be overriden by child classes #1291
+15
−4
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.
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
andgarbage_function
in the children class just to change a few lines of code, which isn't great.This PR adds:
get_threshold
function (users will be able to override that function in case the threshold changes depending on the key).get_keys
function (in my case I'm retrieving the keys from an external API)get_event_data
function (to add custom variable for alerts)Checklist
make test-docker
with my changes.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.