Log and/or post in chat for FindSpam Rules which take more than a defined amount of time #7041
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.
Log and/or post to chat high elapsed times for individual runs of each detection
Rule
This is primarily for debugging and/or monitoring how long individual runs of a
Rule
(detection) takes. Output is to the console and/or into rooms with the "long-rule-times" role (new role).The general definitions are:
Each
Rule
can define its own levels for these outputs, including turning them off. The main watchlist tends to be the rule that takes up the most time. It is currently using:Output to chat will not, currently, be enabled.
In order for there to be chat messages posted, there needs to be a room defined in rooms.yml with the "long-rule-times" role. There currently isn't one. If we want this output in chat under normal operation, I recommend we set up a new room on chat.MSE for this output (e.g. "Charcoal Test MSE"). Putting it on chat.MSE will have the least impact on SmokeDetector chat rate limiting. The output provided isn't something which most users can do anything about, so there's not a lot of benefit for having it in Charcoal HQ.
A unique
rule_id
is now mandatory for each detectionRule
As part of this, each
Rule
is required to have a uniquerule_id
, in addition to thereason
. Thereason
, such as "potentially bad keyword in {}" may be used on any number of detectionRule
entries, but therule_id
must be unique. This is so any characteristics of the detection can be uniquely matched to theRule
when someone is investigating the output. If the first, and only the first,Rule
registered with a particularreason
does not have arule_id
, then thereason
is used as therule_id
for thatRule
.Example chat messages
You can see the following example output in chat here.
Testing for this was done in the Makyen Test 02 chat room around here.