-
Notifications
You must be signed in to change notification settings - Fork 182
[BAPL-1259] Add logging for rule performance analysis #2748
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
Conversation
include::DROOLS-4461-date-picker-for-locadate.adoc[leveloffset=+1] | ||
include::DROOLS-4461-date-picker-for-localdate.adoc[leveloffset=+1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not related to this JIRA but I just found the typo. This typo caused a broken link in release note section.
Thanks @tkobayas , adding @hmanwani-rh who owns this for non-Kogito content. @hmanwani-rh Can you work through this content? Needs some work to conform to module templates, style, etc. You can likely just make edits directly to the files in the PR and commit in GitHub. Toshiya usually doesn't mind that. Or however you want to do it. |
@@ -80,3 +80,5 @@ ifdef::DROOLS,JBPM,OP[] | |||
xref:engine-event-listeners-con_decision-engine[]. | |||
endif::[] | |||
-- | |||
|
|||
include::identify-bottleneck.adoc[leveloffset=+1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hmanwani-rh This include needs to either be elsewhere in an assembly or converted to a segment that instead looks like the other performance tuning sections in this file. See the others above this in the file to see what I mean. In the latter case, might need to be consolidated and not made into a procedure somehow. This approach would be optimal imo, but if it needs to stay a bona fide proc, then should be an include elsewhere I suppose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hmanwani-rh FYI, identify-bottleneck
is linked from drools-metric.adoc
. I'm not sure if we can link to a segment (if we convert identify-bottleneck.adoc
to a segment).
Yes, please edit directly and also it's fine to ask me to edit. Thanks! |
@hmanwani-rh Just a reminder about this PR. Thanks. |
@sterobin @tkobayas, apologies for responding late, since I was on PTO. I would like to make edits in the file to be consistent with other performance tuning sections, but I see I do not have the right to edit the file in Github. @sterobin is there any way that I make the changes to the file in the same branch and commit? If yes, please share the procedure and I will make the edits. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added drools-metric as a section similar to others in performance tuning along with style and formating changes.
Doc previews are as follows:
Designing a Decision Service Using DRL Rules RHPAM
Designing a Decision Service Using DRL Rules RHDM
LGTM. Thank you, @hmanwani-rh ! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hmanwani-rh Thanks! Some minor comments after reviewing the output.
@@ -80,3 +80,69 @@ ifdef::DROOLS,JBPM,OP[] | |||
xref:engine-event-listeners-con_decision-engine[]. | |||
endif::[] | |||
-- | |||
|
|||
Use `drools-metric` to identify the obstruction in your rules:: | |||
You can use `drools-metric` to identify slow rules especially when you have many rules processing. `drools-metric` can also assist in analyzing the {DECISION_ENGINE} performance. Note that `drools-metric` is not for a production environment use. However, you can perform the analysis in your test environment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestions/corrections:
"Use the drools-metric
module to ..."
"can use the drools-metric
module to"
"rules, especially when you process many rules."
"The drools-metric
module" [advised to avoid starting sentence with a name like that, per IBM]
"that the drools-metric
module is not for production environment use"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
You can use `drools-metric` to identify slow rules especially when you have many rules processing. `drools-metric` can also assist in analyzing the {DECISION_ENGINE} performance. Note that `drools-metric` is not for a production environment use. However, you can perform the analysis in your test environment. | ||
|
||
+ | ||
To analyze the {DECISION_ENGINE} performance using `drools-metric`, add `drools-metric` to your project dependency and enable trace logging for `org.drools.metric.util.MetricLogUtils` as follows: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"to your project dependencies ..."
" , as shown in the following example:" [per IBM, don't use "as follows", "the following", etc. before colon, use complete sentence]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
+ | ||
To analyze the {DECISION_ENGINE} performance using `drools-metric`, add `drools-metric` to your project dependency and enable trace logging for `org.drools.metric.util.MetricLogUtils` as follows: | ||
|
||
+ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add the following label to the code snippet, for consistency:
"Example project dependency for drools-metric
"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
NOTE: Only node executions exceeding the threshold are logged. The default value is `500`. | ||
|
||
+ | ||
Once the configuration is completed, rule execution produces logs as follows: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"After you complete the configuration, rule execution produces logs as shown in the following example:" [Opt for active voice when possible, avoid the "as follows"]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
TRACE [EvalConditionNode(9)]: cond=com.sample.Rule_Collect_expensive_orders_combination930932360Eval1Invoker@ee2a6922], evalCount:49500, elapsedMicro:18787 | ||
---- | ||
|
||
+ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest leading the bullets with something like, "In this example, the following key parameters are displayed:"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @sterobin.
Changing it to "The example above includes the following key parameters:"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hmanwani-rh I changed to "This example includes" because per IBM, we should above "above", "below", etc.
* `evalCount` is the number of constraint evaluations against inserted facts during the node execution. | ||
* `elapsedMicro` is the elapsed time of the node execution in microseconds. | ||
|
||
+ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you need to nix this + sign to correct the formatting. Note how the indentation is off from here to the end in the output. Have a look and adjust to fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -0,0 +1,5 @@ | |||
[id='drools-metric'] | |||
|
|||
= drools-metric module for {DECISION_ENGINE} performance analysis |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"= New drools-metric
module for ..." [To avoid starting with a formatted proper name]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Thanks, @sterobin for providing the suggestions. I have incorporated the suggested changes in the content. |
Update nearby distance to new VRP implementation Updated the code Added an explanation
Document for
drools-metric
introduced by https://issues.redhat.com/browse/BAPL-1259I'm sorry about being late to send a PR in the last minutes of 7.41.0.Final release. If it doesn't meet the time (especially, in case that this doc requires revision/update by review), it may be okay to miss in 7.41.0.Final docs... (or probably already too late)