accumulo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [accumulo-testing] lbschanno commented on a change in pull request #90: Move performance tests to accumulo-testing #1200
Date Mon, 29 Jul 2019 22:56:26 GMT
lbschanno commented on a change in pull request #90: Move performance tests to accumulo-testing
#1200
URL: https://github.com/apache/accumulo-testing/pull/90#discussion_r308471075
 
 

 ##########
 File path: src/main/java/org/apache/accumulo/testing/performance/tests/HighSplitCreationPT.java
 ##########
 @@ -0,0 +1,72 @@
+package org.apache.accumulo.testing.performance.tests;
+
+import java.nio.charset.StandardCharsets;
+import java.util.SortedSet;
+import java.util.TreeSet;
+
+import org.apache.accumulo.core.client.AccumuloClient;
+import org.apache.accumulo.core.metadata.MetadataTable;
+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.apache.hadoop.io.Text;
+
+public class HighSplitCreationPT implements PerformanceTest {
+
+  private static final int NUM_SPLITS = 10_000;
+  private static final int MIN_REQUIRED_SPLITS_PER_SECOND = 100;
+  private static final int ONE_SECOND = 1000;
+  private static final String TABLE_NAME = "highSplitCreation";
+  private static final String METADATA_TABLE_SPLITS = "123456789abcde";
+
+  @Override
+  public SystemConfiguration getSystemConfig() {
+    return new SystemConfiguration();
+  }
+
+  @Override
+  public Report runTest(final Environment env) throws Exception {
+    Report.Builder reportBuilder = Report.builder().id("high_split_creation")
+        .description("Evaluate the speed of creating many splits.")
+        .parameter("table_name", TABLE_NAME, "The name of the test table")
+        .parameter("num_splits", NUM_SPLITS, "The high number of splits to add.")
+        .parameter("min_required_splits_per_second", MIN_REQUIRED_SPLITS_PER_SECOND,
+            "The minimum average number of splits that must be created per second before
performance is considered too slow.");
+
+    AccumuloClient client = env.getClient();
+    client.tableOperations().create(TABLE_NAME);
+    client.tableOperations().addSplits(MetadataTable.NAME, getMetadataTableSplits());
+
+    SortedSet<Text> splits = getTestTableSplits();
+
+    long start = System.currentTimeMillis();
+    client.tableOperations().addSplits(TABLE_NAME, splits);
+    long totalTime = System.currentTimeMillis() - start;
+    double splitsPerSecond = NUM_SPLITS / (totalTime / ONE_SECOND);
+
+    reportBuilder.parameter("splits_per_second", splitsPerSecond,
+        "The average number of splits created per second.");
+    reportBuilder.parameter("meets_performance_threshold",
+        splitsPerSecond > MIN_REQUIRED_SPLITS_PER_SECOND,
+        "Whether or not the average split creation meets or exceeds the minimum number of
splits per second.");
 
 Review comment:
   Changes made.

----------------------------------------------------------------
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

Mime
View raw message