From e49df17bd7f0aa8fca620c918fdfd4068022428a Mon Sep 17 00:00:00 2001 From: Pawel Gorgolewski Date: Thu, 6 Jun 2024 12:12:50 +0200 Subject: [PATCH] add rule time service to throttling scenario --- scenarios/throttling/rules.drl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scenarios/throttling/rules.drl b/scenarios/throttling/rules.drl index 4918d12..33b55e7 100644 --- a/scenarios/throttling/rules.drl +++ b/scenarios/throttling/rules.drl @@ -1,6 +1,7 @@ import io.github.hephaestusmetrics.model.metrics.Metric import java.util.List import org.k8loud.executor.actions.openstack.IpThrottleAction +import java.time.Instant global org.k8loud.executor.drools.UsableServices usableServices; global org.k8loud.executor.drools.CronChecker cronChecker; @@ -17,6 +18,7 @@ rule "throttling-rule" ) eval(sum > 90 && cronChecker.checkPatternForSession("0 0/1 * ? * * *")) then + Instant startTime = Instant.now() System.out.println("Processing 'throttling-rule'..."); String[] ipParts = origin.split("\\."); @@ -36,4 +38,5 @@ rule "throttling-rule" .execute(); System.out.println("...Processed 'throttling-rule'"); + usableServices.getRuleTimeService().reportTime(startTime, "Throttling") end