Upgrage GraalVM (#2510)

* Upgrade GraalVM.

Signed-off-by: Tomas Langer <tomas.langer@oracle.com>
This commit is contained in:
Tomas Langer
2020-11-10 00:05:26 +01:00
committed by GitHub
parent bfc0d479d3
commit ac8a3ebb0c
3 changed files with 21 additions and 12 deletions

View File

@@ -51,7 +51,7 @@
<version.lib.failsafe>2.3.1</version.lib.failsafe>
<version.lib.google-api-client>1.30.11</version.lib.google-api-client>
<version.lib.google-error-prone>2.3.3</version.lib.google-error-prone>
<version.lib.graalvm>20.1.0</version.lib.graalvm>
<version.lib.graalvm>20.2.0</version.lib.graalvm>
<version.lib.grpc>1.32.1</version.lib.grpc>
<version.lib.guava>28.1-jre</version.lib.guava>
<version.lib.h2>1.4.199</version.lib.h2>

View File

@@ -73,6 +73,7 @@ import io.helidon.common.Errors;
import io.helidon.config.Config;
import io.helidon.config.ConfigValue;
import io.helidon.metrics.MetricsSupport;
import io.helidon.microprofile.cdi.RuntimeStart;
import io.helidon.microprofile.server.ServerCdiExtension;
import io.helidon.webserver.Routing;
@@ -136,7 +137,8 @@ public class MetricsCdiExtension implements Extension {
private final Set<Class<?>> metricsAnnotatedClasses = new HashSet<>();
private final Set<Class<?>> metricsAnnotatedClassesProcessed = new HashSet<>();
private final Map<Class<?>, Set<Method>> methodsWithSyntheticSimplyTimer = new HashMap<>();
private final Map<Class<?>, Set<Method>> methodsWithSyntheticSimpleTimer = new HashMap<>();
private final Set<Method> syntheticSimpleTimersToRegister = new HashSet<>();
@SuppressWarnings("unchecked")
private static <T> T getReference(BeanManager bm, Type type, Bean<?> bean) {
@@ -321,7 +323,7 @@ public class MetricsCdiExtension implements Extension {
}
metricsAnnotatedClasses.clear();
metricsAnnotatedClassesProcessed.clear();
methodsWithSyntheticSimplyTimer.clear();
methodsWithSyntheticSimpleTimer.clear();
}
/**
@@ -493,7 +495,7 @@ public class MetricsCdiExtension implements Extension {
}
}));
if (!methodsToRecord.isEmpty()) {
methodsWithSyntheticSimplyTimer.put(clazz, methodsToRecord);
methodsWithSyntheticSimpleTimer.put(clazz, methodsToRecord);
}
}
@@ -634,16 +636,21 @@ public class MetricsCdiExtension implements Extension {
producers.clear();
}
private void registerSyntheticSimpleTimerMetric(@Observes ProcessManagedBean<?> pmb) {
private void collectSyntheticSimpleTimerMetric(@Observes ProcessManagedBean<?> pmb) {
AnnotatedType<?> type = pmb.getAnnotatedBeanClass();
Class<?> clazz = type.getJavaClass();
if (!methodsWithSyntheticSimplyTimer.containsKey(clazz)) {
if (!methodsWithSyntheticSimpleTimer.containsKey(clazz)) {
return;
}
LOGGER.log(Level.FINE, () -> "Processing synthetic SimplyTimed annotations for " + clazz.getName());
methodsWithSyntheticSimplyTimer.get(clazz).forEach(MetricsCdiExtension::syntheticSimpleTimer);
syntheticSimpleTimersToRegister.addAll(methodsWithSyntheticSimpleTimer.get(clazz));
}
private void registerSyntheticSimpleTimerMetrics(@Observes @RuntimeStart Object event) {
syntheticSimpleTimersToRegister.forEach(MetricsCdiExtension::syntheticSimpleTimer);
syntheticSimpleTimersToRegister.clear();
}
static boolean restEndpointsMetricEnabledFromConfig() {

View File

@@ -19,6 +19,9 @@ package io.helidon.microprofile.metrics;
import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.inject.Produces;
import io.helidon.common.LazyValue;
import io.helidon.metrics.RegistryFactory;
import org.eclipse.microprofile.metrics.MetricRegistry;
import org.eclipse.microprofile.metrics.MetricRegistry.Type;
import org.eclipse.microprofile.metrics.annotation.RegistryType;
@@ -29,8 +32,7 @@ import org.eclipse.microprofile.metrics.annotation.RegistryType;
@ApplicationScoped
final class RegistryProducer {
private static final io.helidon.metrics.RegistryFactory REGISTRY_FACTORY =
io.helidon.metrics.RegistryFactory.getInstance();
private static final LazyValue<RegistryFactory> REGISTRY_FACTORY = LazyValue.create(RegistryFactory::getInstance);
private RegistryProducer() {
}
@@ -43,19 +45,19 @@ final class RegistryProducer {
@Produces
@RegistryType(type = Type.APPLICATION)
public static org.eclipse.microprofile.metrics.MetricRegistry getApplicationRegistry() {
return REGISTRY_FACTORY.getRegistry(Type.APPLICATION);
return REGISTRY_FACTORY.get().getRegistry(Type.APPLICATION);
}
@Produces
@RegistryType(type = Type.BASE)
public static org.eclipse.microprofile.metrics.MetricRegistry getBaseRegistry() {
return REGISTRY_FACTORY.getRegistry(Type.BASE);
return REGISTRY_FACTORY.get().getRegistry(Type.BASE);
}
@Produces
@RegistryType(type = Type.VENDOR)
public static org.eclipse.microprofile.metrics.MetricRegistry getVendorRegistry() {
return REGISTRY_FACTORY.getRegistry(Type.VENDOR);
return REGISTRY_FACTORY.get().getRegistry(Type.VENDOR);
}
/**