Skip to content

[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

Merged
merged 5 commits into from
Aug 12, 2020

Conversation

tkobayas
Copy link
Contributor

@tkobayas tkobayas commented Jul 31, 2020

Document for drools-metric introduced by https://issues.redhat.com/browse/BAPL-1259

I'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)

include::DROOLS-4461-date-picker-for-locadate.adoc[leveloffset=+1]
include::DROOLS-4461-date-picker-for-localdate.adoc[leveloffset=+1]
Copy link
Contributor Author

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.

@tkobayas tkobayas requested review from sterobin and mariofusco July 31, 2020 03:29
@sterobin sterobin requested a review from hmanwani-rh July 31, 2020 14:14
@sterobin
Copy link
Contributor

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]
Copy link
Contributor

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.

Copy link
Contributor Author

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).

@tkobayas
Copy link
Contributor Author

tkobayas commented Aug 3, 2020

@hmanwani-rh @sterobin

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.

Yes, please edit directly and also it's fine to ask me to edit. Thanks!

@sterobin
Copy link
Contributor

sterobin commented Aug 5, 2020

@hmanwani-rh Just a reminder about this PR. Thanks.

@hmanwani-rh
Copy link
Contributor

hmanwani-rh commented Aug 10, 2020

@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.

Copy link
Contributor

@hmanwani-rh hmanwani-rh left a 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

@tkobayas
Copy link
Contributor Author

LGTM. Thank you, @hmanwani-rh !

Copy link
Contributor

@sterobin sterobin left a 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.
Copy link
Contributor

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"

Copy link
Contributor

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:
Copy link
Contributor

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]

Copy link
Contributor

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:

+
Copy link
Contributor

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"

Copy link
Contributor

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:
Copy link
Contributor

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"]

Copy link
Contributor

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
----

+
Copy link
Contributor

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:"

Copy link
Contributor

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:"

Copy link
Contributor

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.

+
Copy link
Contributor

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.

Copy link
Contributor

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
Copy link
Contributor

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]

Copy link
Contributor

Choose a reason for hiding this comment

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

Done

@sterobin sterobin added the under review Label for PRs pending SME or peer review label Aug 11, 2020
@hmanwani-rh
Copy link
Contributor

@hmanwani-rh Thanks! Some minor comments after reviewing the output.

Thanks, @sterobin for providing the suggestions. I have incorporated the suggested changes in the content.

@sterobin sterobin merged commit 3c703a2 into apache:master Aug 12, 2020
Rikkola pushed a commit to Rikkola/kie-docs that referenced this pull request May 28, 2025
Update nearby distance to new VRP implementation

Updated the code
Added an explanation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
under review Label for PRs pending SME or peer review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants