From 8aee0acb15fc853c3c03c9c4220c2705dc708112 Mon Sep 17 00:00:00 2001 From: extio-de Date: Mon, 23 Jun 2025 12:37:16 +0200 Subject: [PATCH] AgentContext new ctor; --- pom.xml | 2 +- src/main/java/de/extio/lmlib/agent/AgentContext.java | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c5b6003..5838cb3 100755 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ lm-lib de.extio lm-lib - 1.5.0 + 1.5.1 21 diff --git a/src/main/java/de/extio/lmlib/agent/AgentContext.java b/src/main/java/de/extio/lmlib/agent/AgentContext.java index 5eb0a07..3aa8392 100755 --- a/src/main/java/de/extio/lmlib/agent/AgentContext.java +++ b/src/main/java/de/extio/lmlib/agent/AgentContext.java @@ -32,6 +32,12 @@ public final class AgentContext { private volatile boolean skipNextCompletion; + public AgentContext(final Collection agents) { + this.agents = agents.stream().collect(Collectors.toMap(BaseAgent::name, agent -> agent)); + this.context = new ConcurrentHashMap<>(); + this.requestStatistic = new AgentRequestStatistic(); + } + public AgentContext(final Map agents) { this.agents = agents; this.context = new ConcurrentHashMap<>();