EdColeman commented on a change in pull request #1536: Improve master metrics rported via hadoop metrics URL: https://github.com/apache/accumulo/pull/1536#discussion_r385908955
########## File path: test/src/main/java/org/apache/accumulo/test/functional/LegacyMetricsIT.java ########## @@ -0,0 +1,138 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.accumulo.test.functional; + +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import org.apache.accumulo.core.client.AccumuloException; +import org.apache.accumulo.core.client.AccumuloSecurityException; +import org.apache.accumulo.core.client.TableNotFoundException; +import org.apache.accumulo.core.conf.Property; +import org.apache.accumulo.harness.AccumuloClusterHarness; +import org.apache.accumulo.minicluster.impl.MiniAccumuloConfigImpl; +import org.apache.accumulo.test.util.SlowOps; +import org.apache.hadoop.conf.Configuration; +import org.junit.Before; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Basic functional test to verify enabling legacy metrics does not kill master. + */ +public class LegacyMetricsIT extends AccumuloClusterHarness { + + private static final Logger log = LoggerFactory.getLogger(LegacyMetricsIT.class); + + // number of tables / concurrent compactions used during testing. + private final int tableCount = 1; + + private long maxWait = 15_000; + + @Override + public void configureMiniCluster(MiniAccumuloConfigImpl cfg, Configuration hadoopCoreSite) { + cfg.setProperty(Property.GENERAL_LEGACY_METRICS, "true"); + } + + /** + * MANUAL TESTS ONLY - forces pause to allow jconsole connection + */ + private final boolean PAUSE_FOR_MANUAL_TEST = false; + + @Before + public void setup() {} + + @Override + protected int defaultTimeoutSeconds() { + return 4 * 60; + } + + /** + * Validates that the expected metrics are published - this excludes the dynamic metrics derived + * from operation types. + */ + @Test + public void useMaster() { + + boolean legacyMetricsEnabled = + cluster.getSiteConfiguration().getBoolean(Property.GENERAL_LEGACY_METRICS); + + assertTrue(legacyMetricsEnabled); + + List<SlowOps> tables = new ArrayList<>(); + + for (int i = 0; i < tableCount; i++) { + String uniqueName = getUniqueNames(1)[0] + "_" + i; + SlowOps gen = new SlowOps(getConnector(), uniqueName, maxWait, tableCount); + tables.add(gen); + gen.startCompactTask(); + } Review comment: Changed to use table create / delete so master / tablets did have some work required. The compaction only ran for a short while, but create/delete should be quicker. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
