mirror of
https://github.com/keycloak/keycloak.git
synced 2026-01-09 15:02:05 -03:30
Upgrade to Infinispan 16.0.5
- Explicitly utilise "legacy" metrics - Remove explicit `name-as-tags` configuration as Infinispan 16 defaults to true Signed-off-by: Ryan Emerson <remerson@ibm.com>
This commit is contained in:
parent
98735e8a0a
commit
367e0d8740
@ -2,7 +2,6 @@
|
||||
|
||||
{jdgserver_name} exposes metrics in the endpoint `/metrics`.
|
||||
By default, they are enabled.
|
||||
We recommend enabling the attribute `name-as-tags` as it makes the metrics name independent on the cache name.
|
||||
|
||||
To configure metrics in the {jdgserver_name} server, just enabled as shown in the XML below.
|
||||
|
||||
@ -11,7 +10,7 @@ To configure metrics in the {jdgserver_name} server, just enabled as shown in th
|
||||
----
|
||||
<infinispan>
|
||||
<cache-container statistics="true">
|
||||
<metrics gauges="true" histograms="false" name-as-tags="true" />
|
||||
<metrics gauges="true" histograms="false" />
|
||||
</cache-container>
|
||||
</infinispan>
|
||||
----
|
||||
|
||||
@ -241,8 +241,8 @@ public class DefaultCacheEmbeddedConfigProviderFactory implements CacheEmbeddedC
|
||||
.meterRegistry(Metrics.globalRegistry);
|
||||
builder.cacheContainer().statistics(true);
|
||||
builder.metrics()
|
||||
.namesAsTags(true)
|
||||
.histograms(keycloakConfig.getBoolean(HISTOGRAMS, Boolean.FALSE));
|
||||
.histograms(keycloakConfig.getBoolean(HISTOGRAMS, Boolean.FALSE))
|
||||
.legacy(true);
|
||||
holder.getNamedConfigurationBuilders()
|
||||
.values()
|
||||
.stream()
|
||||
|
||||
4
pom.xml
4
pom.xml
@ -92,8 +92,8 @@
|
||||
<hibernate-orm.plugin.version>6.2.13.Final</hibernate-orm.plugin.version>
|
||||
<hibernate.c3p0.version>6.2.13.Final</hibernate.c3p0.version>
|
||||
<hibernate-validator.version>9.0.1.Final</hibernate-validator.version>
|
||||
<infinispan.version>16.0.2</infinispan.version>
|
||||
<protostream.version>6.0.2</protostream.version> <!-- For the annotation processor: keep in sync with the version shipped with Infinispan -->
|
||||
<infinispan.version>16.0.5</infinispan.version>
|
||||
<protostream.version>6.0.3</protostream.version> <!-- For the annotation processor: keep in sync with the version shipped with Infinispan -->
|
||||
<protostream.plugin.version>${protostream.version}</protostream.plugin.version>
|
||||
|
||||
<!--JAKARTA-->
|
||||
|
||||
@ -27,7 +27,6 @@ import org.keycloak.testframework.clustering.LoadBalancer;
|
||||
import org.keycloak.testframework.infinispan.CacheType;
|
||||
import org.keycloak.testframework.logging.JBossLogConsumer;
|
||||
|
||||
import org.infinispan.testcontainers.CountdownLatchLoggingConsumer;
|
||||
import org.jboss.logging.Logger;
|
||||
import org.testcontainers.images.RemoteDockerImage;
|
||||
import org.testcontainers.utility.DockerImageName;
|
||||
|
||||
@ -0,0 +1,34 @@
|
||||
package org.keycloak.testframework.server;
|
||||
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.testcontainers.containers.output.BaseConsumer;
|
||||
import org.testcontainers.containers.output.OutputFrame;
|
||||
|
||||
class CountdownLatchLoggingConsumer extends BaseConsumer<CountdownLatchLoggingConsumer> {
|
||||
|
||||
private final CountDownLatch latch;
|
||||
private final Pattern pattern;
|
||||
|
||||
public CountdownLatchLoggingConsumer(int count, String regex) {
|
||||
this.latch = new CountDownLatch(count);
|
||||
this.pattern = Pattern.compile(regex, Pattern.DOTALL);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void accept(OutputFrame outputFrame) {
|
||||
String log = outputFrame.getUtf8String();
|
||||
if (pattern.matcher(log).matches()) {
|
||||
latch.countDown();
|
||||
}
|
||||
}
|
||||
|
||||
public void await(long timeout, TimeUnit unit) throws InterruptedException, TimeoutException {
|
||||
if (!latch.await(timeout, unit)) {
|
||||
throw new TimeoutException(String.format("After the await period %d %s the count down should be 0 and is %d", timeout, unit, latch.getCount()));
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user