ctubbsii commented on a change in pull request #21: Created performance test framework URL: https://github.com/apache/accumulo-testing/pull/21#discussion_r203940064
########## File path: bin/performance-test ########## @@ -0,0 +1,97 @@ +#! /usr/bin/env bash + +# 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. + +bin_dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) +at_home=$( cd "$( dirname "$bin_dir" )" && pwd ) +at_version=2.0.0-SNAPSHOT + +function print_usage() { + cat <<EOF + +Usage: performance-test <command> (<argument>) + +Possible commands: + run <output dir> Runs performance tests. + compare <result 1> <result 2> Compares results of two test. + csv {files} Converts results to CSV +EOF +} + + +function build_shade_jar() { + at_shaded_jar="$at_home/core/target/accumulo-testing-core-$at_version-shaded.jar" + if [ ! -f "$at_shaded_jar" ]; then + echo "Building $at_shaded_jar" + cd "$at_home" || exit 1 + mvn clean package -P create-shade-jar -D skipTests -D accumulo.version=$(get_version "ACCUMULO") -D hadoop.version=$(get_version "HADOOP") -D zookeeper.version=$(get_version "ZOOKEEPER") + fi +} + +log4j_config="$at_home/conf/log4j.properties" +if [ ! -f "$log4j_config" ]; then + log4j_config="$at_home/conf/log4j.properties.example" + if [ ! -f "$log4j_config" ]; then + echo "Could not find logj4.properties or log4j.properties.example in $at_home/conf" + exit 1 + fi +fi + + +if [ ! -f "$at_home/conf/cluster-control.sh" ]; then + echo "Could not find cluster-control.sh" + exit 1 +fi + +. $at_home/conf/cluster-control.sh +build_shade_jar +CP="$at_home/core/target/accumulo-testing-core-$at_version-shaded.jar" +perf_pkg="org.apache.accumulo.testing.core.performance.impl" +case "$1" in + run) + if [ -z "$2" ]; then + echo "ERROR: <output dir> needs to be set" + print_usage + exit 1 + fi + mkdir -p "$2" + start_cluster + java -cp "$CP" -Dlog4j.configuration="file:$log4j_config" ${perf_pkg}.ListTests | while read test_class; do Review comment: Using the following instead of the `| while read` syntax will fix the issue you're seeing with the file descriptor output errors. ```bash readarray -t testlist < <(java -cp "$CP" -Dlog4j.configuration="file:$log4j_config" ${perf_pkg}.ListTests) for t in "${testlist[@]}"; do ``` ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on 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
