Skip to content
Permalink
Browse files
Adds peer to peer benchmarks. (#135)
* Adds P2P put test benchmark.
* Adds P2P get test benchmark.
* Adds put bytes benchmark.
* Adds SSL parameters to benchmarks.
* Fixes API access for old releases.
  • Loading branch information
pivotal-jbarrett committed Nov 12, 2020
1 parent 0d640d4 commit 539a78419a0c9352c9ccc0a8ffa721c9f9a3a491
Showing 74 changed files with 1,244 additions and 329 deletions.
@@ -1,5 +1,11 @@
# 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
# 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,
@@ -6,3 +6,4 @@ output*/
temp-self-signed.jks
geode-benchmarks/security.json
harness/security.json
failedTests
@@ -1,3 +1,18 @@
# 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.

language: java

jdk:
@@ -52,6 +52,8 @@ Options:
-PoutputDir : Results output directory (-PoutputDir=/tmp/results)
-PtestJVM : Path to an alternative JVM for running the client, locator, and servers. If not specified JAVA_HOME will be used. Note all compilation tasks will still use JAVA_HOME.
-PwithSsl : Flag to run geode with SSL. A self-signed certificate will be generated at runtime.
-PwithSslProtocols : Specifies enabled SSL protocols. See Geode property `ssl-protocols`
-PwithSslCiphers : Specifies enabled SSL chipher suites. See Geode property `ssl-ciphers`
-PwithSecurityManager : Flag to start Geode with the example implementation of SecurityManager
-PwithGc : Select which GC to use. Valid values CMS (default), G1, Z.
-PwithHeap : Specify how large a heap the benchmark VMs should use, default "8g". Accepts any `-Xmx` value, like "32g".
@@ -14,21 +14,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
buildscript {
repositories { gradlePluginPortal() }
dependencies {
classpath 'com.bmuschko:gradle-docker-plugin:4.0.4'
classpath "com.diffplug.spotless:spotless-plugin-gradle:3.16.0"
classpath "io.spring.gradle:dependency-management-plugin:1.0.3.RELEASE"
}
}


plugins { id "org.nosphere.apache.rat" version "0.5.2" }
plugins {
id "io.spring.dependency-management" version "1.0.10.RELEASE"
id "com.bmuschko.docker-remote-api" version "6.6.1"
id "com.diffplug.spotless" version "5.6.1"
id "org.nosphere.apache.rat" version "0.7.0"
}

apply plugin: 'com.bmuschko.docker-remote-api'


// Import task types
import com.bmuschko.gradle.docker.tasks.image.DockerBuildImage
// Load all properties in dependency-version.properties as project properties, so all projects can read them
@@ -40,7 +35,7 @@ dependencyVersions.keys().each{ k -> project.ext[k] = dependencyVersions[k]}
task buildTestingImage(type: DockerBuildImage) {
inputDir = file(project.rootDir)
dockerFile = file('images/geode-performance/Dockerfile')
tag = 'geode-performance-testing:latest'
images.add('geode-performance-testing:latest')
}

apply from: "gradle/spotless.gradle"
@@ -0,0 +1,26 @@
/*
* 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.
*/


plugins { id 'application' }

application { mainClassName = 'org.apache.geode.benchmarks.cryptoinfo.Main' }

compileJava {
options.compilerArgs << '-Xlint:unchecked' << "-Werror"
options.deprecation = true
}
@@ -0,0 +1,57 @@
/*
* 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.benchmarks.cryptoinfo;

import java.io.PrintStream;
import java.security.NoSuchAlgorithmException;
import java.security.Provider;

import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLParameters;

public class Main {
public static void main(String[] args) throws NoSuchAlgorithmException {
SSLContext context = SSLContext.getDefault();
final PrintStream out = System.out;
out.println("Provider: ");
printProvider(out, context.getProvider());
out.println("SSL Parameters: ");
printSSLParameters(out, context.getSupportedSSLParameters());
}

private static void printSSLParameters(final PrintStream out, final SSLParameters sslParameters) {
out.println("Protocols:");
printStrings(out, sslParameters.getProtocols());
out.println("Cipher Suites:");
printStrings(out, sslParameters.getCipherSuites());
}

private static void printStrings(PrintStream out, String[] strings) {
for (String string : strings) {
out.println(string);
}
}

private static void printProvider(final PrintStream out, final Provider provider) {
out.print("Name: ");
out.println(provider.getName());
out.print("Info: ");
out.println(provider.getInfo());
out.print("Version: ");
out.println(provider.getVersion());
}

}
@@ -1,3 +1,18 @@
# 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.

#Whether to use 'space', 'tab' or 'mixed' (both) characters for indentation.
#The default value is 'tab'.
org.eclipse.jdt.core.formatter.tabulation.char=space
@@ -15,6 +15,8 @@
* limitations under the License.
*/

import org.gradle.util.VersionNumber

plugins { id 'java' }

group 'org.apache.geode-benchmark'
@@ -47,7 +49,11 @@ dependencies {
implementation(project(':harness'))

implementation(group: 'org.apache.geode', name: 'geode-core', version: geodeVersion)
runtime(group: 'org.apache.geode', name: 'geode-log4j', version: geodeVersion)
if (VersionNumber.parse(geodeVersion) >= VersionNumber.parse("1.11.0")) {
runtime(group: 'org.apache.geode', name: 'geode-log4j', version: geodeVersion)
} else {
runtime(group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.13.3')
}

// Required for missing dependency on geode-core.
runtime(group: 'org.eclipse.jetty', name: 'jetty-webapp', version: '9.4.12.v20180830')
@@ -56,6 +62,11 @@ dependencies {
testImplementation(group: 'org.assertj', name: 'assertj-core', version: project.'assertj-core.version')
}

compileJava {
options.compilerArgs << '-Xlint:unchecked' << "-Werror"
options.deprecation = true
}

test{ useJUnitPlatform() }

task benchmark(type: Test) {
@@ -69,9 +80,9 @@ task benchmark(type: Test) {
testLogging { exceptionFormat = 'full' }

exclude "**/NoopBenchmark.class"
exclude "**/*LongBenchmark.class"

forkEvery 1
failFast = true

systemProperty 'TEST_HOSTS', project.findProperty('hosts')
systemProperty 'TEST_METADATA', project.findProperty('metadata')
@@ -92,6 +103,8 @@ task benchmark(type: Test) {
systemProperty 'withDuration', project.findProperty('withDuration')
}
systemProperty 'withSsl', project.hasProperty('withSsl')
systemProperty 'withSslProtocols', project.findProperty('withSslProtocols')
systemProperty 'withSslCiphers', project.findProperty('withSslCiphers')
systemProperty 'withSniProxy', project.hasProperty('withSniProxy')
systemProperty 'withSecurityManager', project.hasProperty('withSecurityManager')
systemProperty 'benchmark.profiler.argument', project.findProperty('benchmark.profiler.argument')
@@ -20,14 +20,14 @@
import org.apache.geode.cache.execute.FunctionContext;
import org.apache.geode.cache.execute.RegionFunctionContext;

public class FunctionWithArguments implements Function {
public class FunctionWithArguments implements Function<Long> {

public FunctionWithArguments() {}

@Override
public void execute(final FunctionContext context) {
public void execute(final FunctionContext<Long> context) {
final RegionFunctionContext regionFunctionContext = (RegionFunctionContext) context;
final Region region = regionFunctionContext.getDataSet();
final Region<?, ?> region = regionFunctionContext.getDataSet();
final Long key = (Long) regionFunctionContext.getArguments();
context.getResultSender().lastResult(region.get(key));
}
@@ -21,12 +21,12 @@
import org.apache.geode.cache.execute.FunctionContext;
import org.apache.geode.cache.execute.RegionFunctionContext;

public class FunctionWithFilter implements Function {
public class FunctionWithFilter implements Function<Long> {

public FunctionWithFilter() {}

@Override
public void execute(final FunctionContext context) {
public void execute(final FunctionContext<Long> context) {
final RegionFunctionContext regionFunctionContext = (RegionFunctionContext) context;
final Region<Long, Portfolio> region = regionFunctionContext.getDataSet();
@SuppressWarnings("unchecked")
@@ -14,6 +14,10 @@
*/
package org.apache.geode.benchmark.parameters;

import static org.apache.geode.benchmark.topology.Topology.WITH_SECURITY_MANAGER_PROPERTY;
import static org.apache.geode.benchmark.topology.Topology.WITH_SSL_CIPHERS_PROPERTY;
import static org.apache.geode.benchmark.topology.Topology.WITH_SSL_PROPERTY;
import static org.apache.geode.benchmark.topology.Topology.WITH_SSL_PROTOCOLS_PROPERTY;
import static org.apache.geode.distributed.ConfigurationProperties.ARCHIVE_DISK_SPACE_LIMIT;
import static org.apache.geode.distributed.ConfigurationProperties.ARCHIVE_FILE_SIZE_LIMIT;
import static org.apache.geode.distributed.ConfigurationProperties.CONSERVE_SOCKETS;
@@ -28,7 +32,9 @@
import static org.apache.geode.distributed.ConfigurationProperties.REMOVE_UNRESPONSIVE_CLIENT;
import static org.apache.geode.distributed.ConfigurationProperties.SECURITY_MANAGER;
import static org.apache.geode.distributed.ConfigurationProperties.SERIALIZABLE_OBJECT_FILTER;
import static org.apache.geode.distributed.ConfigurationProperties.SSL_CIPHERS;
import static org.apache.geode.distributed.ConfigurationProperties.SSL_ENABLED_COMPONENTS;
import static org.apache.geode.distributed.ConfigurationProperties.SSL_PROTOCOLS;
import static org.apache.geode.distributed.ConfigurationProperties.STATISTIC_SAMPLING_ENABLED;
import static org.apache.geode.distributed.ConfigurationProperties.USE_CLUSTER_CONFIGURATION;
import static org.apache.geode.security.SecurableCommunicationChannels.ALL;
@@ -90,15 +96,27 @@ public static Properties withSecurityManager(Properties properties) {

public static Properties withSsl(Properties properties) {
properties.setProperty(SSL_ENABLED_COMPONENTS, ALL);
final String withSslProtocols = System.getProperty(WITH_SSL_PROTOCOLS_PROPERTY);
if (!isBlank(withSslProtocols)) {
properties.setProperty(SSL_PROTOCOLS, withSslProtocols);
}
final String withSslCiphers = System.getProperty(WITH_SSL_CIPHERS_PROPERTY);
if (!isBlank(withSslCiphers)) {
properties.setProperty(SSL_CIPHERS, withSslCiphers);
}
return properties;
}

private static boolean isBlank(final String value) {
return null == value || value.trim().isEmpty();
}

private static boolean isSecurityManagerEnabled() {
return isPropertySet("withSecurityManager");
return isPropertySet(WITH_SECURITY_MANAGER_PROPERTY);
}

private static boolean isSslEnabled() {
return isPropertySet("withSsl");
return isPropertySet(WITH_SSL_PROPERTY);
}

private static boolean isPropertySet(final String propertyName) {
@@ -46,4 +46,14 @@ public static void addToTestConfig(TestConfig testConfig, String systemPropertyK
configureGeodeProductJvms(testConfig, jvmArgument);
}
}

public static void addToTestConfig(TestConfig testConfig, String systemPropertyKey) {
if (System.getProperties().containsKey(systemPropertyKey)) {
final String value = System.getProperty(systemPropertyKey);
final String jvmArgument = "-D" + systemPropertyKey + "=" + value + "";
logger.info("Configuring JVMs to run with " + jvmArgument);
configureGeodeProductJvms(testConfig, jvmArgument);
}
}

}
@@ -19,11 +19,11 @@

import java.util.Properties;

import org.apache.geode.LogWriter;
import org.apache.geode.distributed.DistributedMember;
import org.apache.geode.security.AuthInitialize;
import org.apache.geode.security.AuthenticationFailedException;

@SuppressWarnings("deprecation")
public class ExampleAuthInit implements AuthInitialize {

private static final String USER_NAME = "security-username";
@@ -53,12 +53,11 @@ public Properties getCredentials(Properties securityProps) throws Authentication
public void close() {}

@Override
@Deprecated
public void init(LogWriter systemLogger, LogWriter securityLogger)
public void init(org.apache.geode.LogWriter systemLogger,
org.apache.geode.LogWriter securityLogger)
throws AuthenticationFailedException {}

@Override
@Deprecated
public Properties getCredentials(Properties securityProps, DistributedMember server,
boolean isPeer) throws AuthenticationFailedException {
return getCredentials(securityProps);

0 comments on commit 539a784

Please sign in to comment.