Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
GEODE-9176: Automatically pass properties to benchmark JVMs (#149)
Converting all of the system properties we use in the benchmarks to start with the benchmark prefix. Changing the gradle build to copy all benchmark.* properties as system properties in the tst. Getting rid of problematic org.json dependency, and also making sure we capture *all* system properties that might effect the behavior of the test. Adding a way to automatically set system properties in test JVMs. Just add a property with the prefix benchmark.system.ROLE, where ROLE is the role of jvms to target. Eg benchmark.system.server.gemfire.disablePartitionedRegionBucketAck=true would set gemfire.disablePartitionedRegionBucketAck=true in the server JVMs. Logging all benchmark properties during test run
- Loading branch information
1 parent
ec0a225
commit 569cf39ea6357e87b66999fcffe0fca146d1d7a0
Showing
22 changed files
with
211 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -30,7 +30,7 @@ | ||
|
||
class HeapParametersTest { | ||
|
||
private static final String WITH_HEAP = "withHeap"; | ||
private static final String WITH_HEAP = "benchmark.withHeap"; | ||
|
||
private Properties systemProperties; | ||
|
||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,47 @@ | ||
/* | ||
* 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.geode.perftest; | ||
|
||
import java.util.ArrayList; | ||
import java.util.HashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
public class BenchmarkProperties { | ||
|
||
/** | ||
* Read the current system properties and find any system properties that start | ||
* with "benchmark.system.ROLE" Returns a map of ROLE-> system properties for that | ||
* role. | ||
*/ | ||
public static Map<String, List<String>> getDefaultJVMArgs() { | ||
Map<String, List<String>> results = new HashMap<>(); | ||
System.getProperties().stringPropertyNames().stream() | ||
.filter(name -> name.startsWith("benchmark.system.")) | ||
.forEach(name -> { | ||
String shortName = name.replace("benchmark.system.", ""); | ||
String[] roleAndProperty = shortName.split("\\.", 2); | ||
String role = roleAndProperty[0]; | ||
String property = roleAndProperty[1]; | ||
String value = System.getProperty(name); | ||
List<String> roleProperties = results.computeIfAbsent(role, key -> new ArrayList<>()); | ||
roleProperties.add("-D" + property + "=" + value); | ||
}); | ||
return results; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.