You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2019/07/23 18:31:36 UTC
[GitHub] [accumulo-testing] Manno15 commented on a change in pull request
#93: Fixes #59 Create herding performance test
Manno15 commented on a change in pull request #93: Fixes #59 Create herding performance test
URL: https://github.com/apache/accumulo-testing/pull/93#discussion_r306469672
##########
File path: src/main/java/org/apache/accumulo/testing/performance/tests/HerdingPT.java
##########
@@ -0,0 +1,165 @@
+/*
+ * 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.testing.performance.tests;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Random;
+import java.util.concurrent.CyclicBarrier;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
+
+import org.apache.accumulo.core.client.AccumuloClient;
+import org.apache.accumulo.core.client.AccumuloException;
+import org.apache.accumulo.core.client.AccumuloSecurityException;
+import org.apache.accumulo.core.client.BatchWriter;
+import org.apache.accumulo.core.client.MutationsRejectedException;
+import org.apache.accumulo.core.client.Scanner;
+import org.apache.accumulo.core.client.TableExistsException;
+import org.apache.accumulo.core.client.TableNotFoundException;
+import org.apache.accumulo.core.conf.Property;
+import org.apache.accumulo.core.data.Mutation;
+import org.apache.accumulo.core.data.Range;
+import org.apache.accumulo.core.security.Authorizations;
+import org.apache.accumulo.testing.performance.Environment;
+import org.apache.accumulo.testing.performance.PerformanceTest;
+import org.apache.accumulo.testing.performance.Report;
+import org.apache.accumulo.testing.performance.SystemConfiguration;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class HerdingPT implements PerformanceTest {
+
+ private static final Logger LOG = LoggerFactory.getLogger(HerdingPT.class);
+
+ private static final byte[] COL_FAM = "pinky".getBytes();
+
+ private static final int NUM_ROWS = 1_000_000;
+ private static final int NUM_COLS = 10;
+ private static final int NUM_THREADS = 32;
+ private static final int NUM_LOAD_ATTEMPTS = 1_000;
+
+ private static final String TABLE_NAME = "herd";
+ private static final String DESCRIPTION = "Test herding performance with " + NUM_THREADS
+ + " threads attempting to " + "simultaneously load the same block " + NUM_LOAD_ATTEMPTS
+ + " times.";
+
+ private final Random random = new Random();
+
+ @Override
+ public SystemConfiguration getSystemConfig() {
+ Map<String,String> config = new HashMap<>();
+
+ config.put(Property.TABLE_BLOCKCACHE_ENABLED.getKey(), "true");
+
+ return new SystemConfiguration().setAccumuloConfig(config);
+ }
+
+ @Override
+ public Report runTest(final Environment env) throws Exception {
+ Report.Builder reportBuilder = Report.builder().id("herdingPT").description(DESCRIPTION)
+ .parameter("table_name", TABLE_NAME, "The name of the table.")
+ .parameter("num_threads", NUM_THREADS, "The number of threads.")
+ .parameter("num_load_attempts", NUM_LOAD_ATTEMPTS,
+ "The number of times the threads will attempt to load the same block.")
+ .parameter("num_rows", NUM_ROWS, "The number of rows that will be loaded into the table.");
+
+ final AccumuloClient client = env.getClient();
+ initTable(client);
+ long herdTime = getHerdingDuration(client);
+ reportBuilder.parameter("herd_time", herdTime, "The time (in ms) it took herding to complete.");
Review comment:
`reportBuilder.parameter` should be replaced with `reportBuilder.result` for the resulting value of the performance test
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services