Skip to content

Commit

Permalink
fix: dont send session stats after every action when audit skipped (#704
Browse files Browse the repository at this point in the history
)

https://issues.redhat.com/browse/AAP-28915
When doing performance testing the session stats after every action
causes the DB to be updated. If we are skipping audit events we can send
the session stats at the regular heartbeat interval and when the
rulebook ends.
  • Loading branch information
mkanoor authored Aug 12, 2024
1 parent a2b86cd commit 2665c5a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ansible_rulebook/rule_set_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,11 @@ async def _drain_actionplan_queue(self):
queue_item = await self.ruleset_queue_plan.plan.queue.get()
rule_run_at = run_at()
action_item = cast(ActionContext, queue_item)
if self.parsed_args and self.parsed_args.heartbeat > 0:
if (
self.parsed_args
and self.parsed_args.heartbeat > 0
and not settings.skip_audit_events
):
await send_session_stats(
self.event_log,
session_stats(self.ruleset_queue_plan.ruleset.name),
Expand Down

0 comments on commit 2665c5a

Please sign in to comment.