This is an automated email from the ASF dual-hosted git repository. edcoleman pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/accumulo.git
The following commit(s) were added to refs/heads/main by this push: new e682a2f229 Fix test failures after metrics merge (#4500) e682a2f229 is described below commit e682a2f2296cf95a32d58250aeef612b61147936 Author: EdColeman <d...@etcoleman.com> AuthorDate: Sat Apr 27 15:58:24 2024 -0400 Fix test failures after metrics merge (#4500) --- .../java/org/apache/accumulo/core/metrics/MetricsProducer.java | 4 ++-- .../org/apache/accumulo/coordinator/CompactionCoordinator.java | 1 + .../monitor/src/main/java/org/apache/accumulo/monitor/Monitor.java | 1 + .../src/main/java/org/apache/accumulo/tserver/TabletServer.java | 4 ++-- .../org/apache/accumulo/test/functional/MemoryStarvedScanIT.java | 7 +++++-- .../java/org/apache/accumulo/test/functional/ZombieTServer.java | 6 ++++++ 6 files changed, 17 insertions(+), 6 deletions(-) diff --git a/core/src/main/java/org/apache/accumulo/core/metrics/MetricsProducer.java b/core/src/main/java/org/apache/accumulo/core/metrics/MetricsProducer.java index e50d2d9c03..5e43b2a938 100644 --- a/core/src/main/java/org/apache/accumulo/core/metrics/MetricsProducer.java +++ b/core/src/main/java/org/apache/accumulo/core/metrics/MetricsProducer.java @@ -610,8 +610,8 @@ public interface MetricsProducer { String METRICS_SCAN_CONTINUE = METRICS_SCAN_PREFIX + "continue"; String METRICS_SCAN_CLOSE = METRICS_SCAN_PREFIX + "close"; String METRICS_SCAN_BUSY_TIMEOUT = METRICS_SCAN_PREFIX + "busy.timeout"; - String METRICS_SCAN_PAUSED_FOR_MEM = METRICS_SCAN_PREFIX + ".paused.for.memory"; - String METRICS_SCAN_RETURN_FOR_MEM = METRICS_SCAN_PREFIX + ".return.early.for.memory"; + String METRICS_SCAN_PAUSED_FOR_MEM = METRICS_SCAN_PREFIX + "paused.for.memory"; + String METRICS_SCAN_RETURN_FOR_MEM = METRICS_SCAN_PREFIX + "return.early.for.memory"; String METRICS_TSERVER_PREFIX = "accumulo.tserver."; String METRICS_TSERVER_ENTRIES = METRICS_TSERVER_PREFIX + "entries"; diff --git a/server/compaction-coordinator/src/main/java/org/apache/accumulo/coordinator/CompactionCoordinator.java b/server/compaction-coordinator/src/main/java/org/apache/accumulo/coordinator/CompactionCoordinator.java index ec8cdc514c..45570110d6 100644 --- a/server/compaction-coordinator/src/main/java/org/apache/accumulo/coordinator/CompactionCoordinator.java +++ b/server/compaction-coordinator/src/main/java/org/apache/accumulo/coordinator/CompactionCoordinator.java @@ -264,6 +264,7 @@ public class CompactionCoordinator extends AbstractServer MetricsInfo metricsInfo = getContext().getMetricsInfo(); metricsInfo.addServiceTags(getApplicationName(), clientAddress); + metricsInfo.addMetricsProducers(this); metricsInfo.init(); // On a re-start of the coordinator it's possible that external compactions are in-progress. diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/Monitor.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/Monitor.java index fde338f422..6c07e9bb32 100644 --- a/server/monitor/src/main/java/org/apache/accumulo/monitor/Monitor.java +++ b/server/monitor/src/main/java/org/apache/accumulo/monitor/Monitor.java @@ -494,6 +494,7 @@ public class Monitor extends AbstractServer implements HighlyAvailableService { MetricsInfo metricsInfo = getContext().getMetricsInfo(); metricsInfo.addServiceTags(getApplicationName(), HostAndPort.fromParts(advertiseHost, livePort)); + metricsInfo.addMetricsProducers(this); metricsInfo.init(); try { diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java index 89d503ef58..409d1ecada 100644 --- a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java +++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java @@ -714,8 +714,8 @@ public class TabletServer extends AbstractServer implements TabletHostingServer ceMetrics = new CompactionExecutorsMetrics(); pausedMetrics = new PausedCompactionMetrics(); - metricsInfo.addMetricsProducers(metrics, updateMetrics, scanMetrics, mincMetrics, ceMetrics, - pausedMetrics); + metricsInfo.addMetricsProducers(this, metrics, updateMetrics, scanMetrics, mincMetrics, + ceMetrics, pausedMetrics); metricsInfo.init(); this.compactionManager = new CompactionManager(() -> Iterators diff --git a/test/src/main/java/org/apache/accumulo/test/functional/MemoryStarvedScanIT.java b/test/src/main/java/org/apache/accumulo/test/functional/MemoryStarvedScanIT.java index 59b9a535b8..d2cb595b3d 100644 --- a/test/src/main/java/org/apache/accumulo/test/functional/MemoryStarvedScanIT.java +++ b/test/src/main/java/org/apache/accumulo/test/functional/MemoryStarvedScanIT.java @@ -45,6 +45,7 @@ import org.apache.accumulo.core.data.Range; import org.apache.accumulo.core.data.Value; import org.apache.accumulo.core.iterators.WrappingIterator; import org.apache.accumulo.core.metrics.MetricsProducer; +import org.apache.accumulo.core.spi.metrics.LoggingMeterRegistryFactory; import org.apache.accumulo.harness.MiniClusterConfigurationCallback; import org.apache.accumulo.harness.SharedMiniClusterBase; import org.apache.accumulo.minicluster.MemoryUnit; @@ -77,8 +78,10 @@ public class MemoryStarvedScanIT extends SharedMiniClusterBase { // Tell the server processes to use a StatsDMeterRegistry that will be configured // to push all metrics to the sink we started. cfg.setProperty(Property.GENERAL_MICROMETER_ENABLED, "true"); - cfg.setProperty(Property.GENERAL_MICROMETER_FACTORY, - TestStatsDRegistryFactory.class.getName()); + cfg.setProperty("general.custom.metrics.opts.logging.step", "5s"); + String clazzList = LoggingMeterRegistryFactory.class.getName() + "," + + TestStatsDRegistryFactory.class.getName(); + cfg.setProperty(Property.GENERAL_MICROMETER_FACTORY, clazzList); Map<String,String> sysProps = Map.of(TestStatsDRegistryFactory.SERVER_HOST, "127.0.0.1", TestStatsDRegistryFactory.SERVER_PORT, Integer.toString(sink.getPort())); cfg.setSystemProperties(sysProps); diff --git a/test/src/main/java/org/apache/accumulo/test/functional/ZombieTServer.java b/test/src/main/java/org/apache/accumulo/test/functional/ZombieTServer.java index a56c34fe3f..d7562f78c1 100644 --- a/test/src/main/java/org/apache/accumulo/test/functional/ZombieTServer.java +++ b/test/src/main/java/org/apache/accumulo/test/functional/ZombieTServer.java @@ -37,6 +37,7 @@ import org.apache.accumulo.core.lock.ServiceLock.LockWatcher; import org.apache.accumulo.core.lock.ServiceLockData; import org.apache.accumulo.core.lock.ServiceLockData.ThriftService; import org.apache.accumulo.core.manager.thrift.TabletServerStatus; +import org.apache.accumulo.core.metrics.MetricsInfo; import org.apache.accumulo.core.rpc.clients.ThriftClientTypes; import org.apache.accumulo.core.securityImpl.thrift.TCredentials; import org.apache.accumulo.core.tabletscan.thrift.TabletScanClientService; @@ -131,6 +132,11 @@ public class ZombieTServer { HostAndPort.fromParts("0.0.0.0", port)); String addressString = serverPort.address.toString(); + + MetricsInfo metricsInfo = context.getMetricsInfo(); + metricsInfo.addServiceTags("zombie.server", serverPort.address); + metricsInfo.init(); + var zLockPath = ServiceLock.path(context.getZooKeeperRoot() + Constants.ZTSERVERS + "/" + addressString); ZooReaderWriter zoo = context.getZooReaderWriter();