diff options
author | Bjørn Christian Seime <bjorncs@oath.com> | 2019-01-17 13:44:29 +0100 |
---|---|---|
committer | Bjørn Christian Seime <bjorncs@verizonmedia.com> | 2019-01-22 12:26:50 +0100 |
commit | c5dea8617b63687f8c28b38526bdb88ee3d5c256 (patch) | |
tree | ae307860196bced458540796e83956fc8b35e39c /container-disc | |
parent | b626c5ca04e8f4a19c331bd6b66f30c1ea6c6ec5 (diff) |
Revert "Add tracking of jrt metrics"
This reverts commit 299d205912af1b3ebdb16a1fc037dd0770288be3.
Diffstat (limited to 'container-disc')
4 files changed, 0 insertions, 128 deletions
diff --git a/container-disc/src/main/java/com/yahoo/container/jdisc/jrt/DefaultJrtFactory.java b/container-disc/src/main/java/com/yahoo/container/jdisc/jrt/DefaultJrtFactory.java deleted file mode 100644 index 93a72e200e0..00000000000 --- a/container-disc/src/main/java/com/yahoo/container/jdisc/jrt/DefaultJrtFactory.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2019 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -package com.yahoo.container.jdisc.jrt; - -import com.google.inject.Inject; -import com.yahoo.component.AbstractComponent; -import com.yahoo.jdisc.Metric; -import com.yahoo.jrt.Supervisor; -import com.yahoo.jrt.Transport; - -/** - * The default factory for JRT {@link Supervisor}. Tracks jrt metrics. - * - * @author bjorncs - */ -public class DefaultJrtFactory extends AbstractComponent implements JrtFactory { - - private final JrtMetricsUpdater metricsUpdater; - - @Inject - public DefaultJrtFactory(Metric metric) { - this.metricsUpdater = new JrtMetricsUpdater(metric); - } - - @Override - public Supervisor createSupervisor() { - Supervisor supervisor = new Supervisor(new Transport()); - metricsUpdater.register(supervisor); - return supervisor; - } - - @Override - public void deconstruct() { - metricsUpdater.stop(); - } -} diff --git a/container-disc/src/main/java/com/yahoo/container/jdisc/jrt/JrtFactory.java b/container-disc/src/main/java/com/yahoo/container/jdisc/jrt/JrtFactory.java deleted file mode 100644 index 052aaad1bd7..00000000000 --- a/container-disc/src/main/java/com/yahoo/container/jdisc/jrt/JrtFactory.java +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2019 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -package com.yahoo.container.jdisc.jrt; - -import com.yahoo.jrt.Supervisor; - -/** - * A factory for JRT {@link Supervisor} - * - * @author bjorncs - */ -public interface JrtFactory { - - Supervisor createSupervisor(); - -} diff --git a/container-disc/src/main/java/com/yahoo/container/jdisc/jrt/JrtMetricsUpdater.java b/container-disc/src/main/java/com/yahoo/container/jdisc/jrt/JrtMetricsUpdater.java deleted file mode 100644 index ede0f060ec9..00000000000 --- a/container-disc/src/main/java/com/yahoo/container/jdisc/jrt/JrtMetricsUpdater.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2019 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -package com.yahoo.container.jdisc.jrt; - -import com.google.inject.Inject; -import com.yahoo.jdisc.Metric; -import com.yahoo.jrt.Supervisor; -import com.yahoo.jrt.TransportMetrics; - -import java.util.Map; -import java.util.Timer; -import java.util.TimerTask; -import java.util.WeakHashMap; - -/** - * Propagates JRT metric values ({@link TransportMetrics} to {@link Metric}. - * - * @author bjorncs - */ -public class JrtMetricsUpdater { - - private final Object monitor = new Object(); - private final Timer timer = new Timer("jrt-metrics-updater", true); - private final Map<TransportMetrics, Metric.Context> transportMetricsInstances = new WeakHashMap<>(); - private final Metric metric; - - @Inject - public JrtMetricsUpdater(Metric metric) { - this.metric = metric; - timer.scheduleAtFixedRate(new UpdaterTask(), /*delay ms*/0, /*period ms*/10_000); - } - - public void register(Supervisor supervisor) { - register(supervisor, null); - } - - public void register(Supervisor supervisor, Map<String, ?> dimensions) { - synchronized (monitor) { - this.transportMetricsInstances.put(supervisor.transport().metrics(), metric.createContext(dimensions)); - } - } - - public void deregister(Supervisor supervisor) { - synchronized (monitor) { - this.transportMetricsInstances.remove(supervisor.transport().metrics()); - } - } - - public void stop() { - timer.cancel(); - synchronized (monitor) { - this.transportMetricsInstances.clear(); - } - } - - private class UpdaterTask extends TimerTask { - @Override - public void run() { - synchronized (monitor) { - transportMetricsInstances.forEach((instance, context) -> { - metric.add("jrt.transport.tls-certificate-verification-failures", instance.tlsCertificateVerificationFailures(), context); - metric.add("jrt.transport.peer-authorization-failures", instance.peerAuthorizationFailures(), context); - metric.add("jrt.transport.server.tls-connections-established", instance.serverTlsConnectionsEstablished(), context); - metric.add("jrt.transport.client.tls-connections-established", instance.clientTlsConnectionsEstablished(), context); - metric.add("jrt.transport.server.unencrypted-connections-established", instance.serverUnencryptedConnectionsEstablished(), context); - metric.add("jrt.transport.client.unencrypted-connections-established", instance.clientUnencryptedConnectionsEstablished(), context); - }); - } - } - } -} diff --git a/container-disc/src/main/java/com/yahoo/container/jdisc/jrt/package-info.java b/container-disc/src/main/java/com/yahoo/container/jdisc/jrt/package-info.java deleted file mode 100644 index a584a9b4fb7..00000000000 --- a/container-disc/src/main/java/com/yahoo/container/jdisc/jrt/package-info.java +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright 2019 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -/** - * @author bjorncs - */ -@ExportPackage -package com.yahoo.container.jdisc.jrt; - -import com.yahoo.osgi.annotation.ExportPackage;
\ No newline at end of file |