Skip to content

Commit

Permalink
add rule time service to throttling scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
pgorgolew committed Jun 6, 2024
1 parent 9da23ec commit e49df17
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions scenarios/throttling/rules.drl
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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("\\.");
Expand All @@ -36,4 +38,5 @@ rule "throttling-rule"
.execute();

System.out.println("...Processed 'throttling-rule'");
usableServices.getRuleTimeService().reportTime(startTime, "Throttling")
end

0 comments on commit e49df17

Please sign in to comment.