From 92afaeb4a959ea5a6a072fe3ed7a01088d703e0b Mon Sep 17 00:00:00 2001 From: Jan Srnicek Date: Tue, 31 Jan 2017 10:00:51 +0100 Subject: HONEYCOMB-293 - Memory benchmarking Contains configuration for benchmarks: - Honeycomb on rest(just infra, no data) - Honeycomb with 1000 data nodes - Honeycomb with 10000 data nodes Each benchmark outputs two files: - out_path_name-HeapMemoryUsage.csv - out_path_name-NonHeapMemoryUsage.csv Both files are in format : committed,init,max,used 109576192,109051904,1525153792,12194752 Data sample sizes can be easily adjusted, just by changing start parameter -DsampleSize Change-Id: If6f9919307574237689326b4a38d410ec563200a Signed-off-by: Marek Gradzki Signed-off-by: Jan Srnicek --- infra/it/memory-benchmark-scripts/pom.xml | 72 ++++++++++++++++++++++ .../MemoryBenchmarkStartupScriptGenerator.groovy | 38 ++++++++++++ .../src/main/resources/memoryBenchmarkScript | 2 + 3 files changed, 112 insertions(+) create mode 100644 infra/it/memory-benchmark-scripts/pom.xml create mode 100644 infra/it/memory-benchmark-scripts/src/main/groovy/io/fd/honeycomb/benchmark/script/MemoryBenchmarkStartupScriptGenerator.groovy create mode 100644 infra/it/memory-benchmark-scripts/src/main/resources/memoryBenchmarkScript (limited to 'infra/it/memory-benchmark-scripts') diff --git a/infra/it/memory-benchmark-scripts/pom.xml b/infra/it/memory-benchmark-scripts/pom.xml new file mode 100644 index 000000000..b6b29e5e2 --- /dev/null +++ b/infra/it/memory-benchmark-scripts/pom.xml @@ -0,0 +1,72 @@ + + + + + + + + 2.0 + 2.4.7 + 2.9.2-01 + 2.4.3-01 + + + 4.0.0 + io.fd.honeycomb.it + benchmark-scripts + 1.17.04-SNAPSHOT + jar + + + + + + org.apache.maven.plugins + maven-site-plugin + + true + true + + + + + + + org.codehaus.groovy + groovy-eclipse-compiler + ${groovy.eclipse.compiler.version} + true + + + maven-compiler-plugin + + + groovy-eclipse-compiler + + + + org.codehaus.groovy + groovy-eclipse-compiler + ${groovy.eclipse.compiler.version} + + + + org.codehaus.groovy + groovy-eclipse-batch + ${groovy.eclipse.batch.version} + + + + + + + + + org.codehaus.groovy + groovy-all + ${groovy.version} + + + \ No newline at end of file diff --git a/infra/it/memory-benchmark-scripts/src/main/groovy/io/fd/honeycomb/benchmark/script/MemoryBenchmarkStartupScriptGenerator.groovy b/infra/it/memory-benchmark-scripts/src/main/groovy/io/fd/honeycomb/benchmark/script/MemoryBenchmarkStartupScriptGenerator.groovy new file mode 100644 index 000000000..1db656aca --- /dev/null +++ b/infra/it/memory-benchmark-scripts/src/main/groovy/io/fd/honeycomb/benchmark/script/MemoryBenchmarkStartupScriptGenerator.groovy @@ -0,0 +1,38 @@ +package io.fd.honeycomb.benchmark.script + +import groovy.text.SimpleTemplateEngine + +import java.nio.file.Files +import java.nio.file.Paths + +class MemoryBenchmarkStartupScriptGenerator { + + static final def STARTUP_SCRIPT_ON_REST_TEMPLATE = MemoryBenchmarkStartupScriptGenerator.getResource("/memoryBenchmarkScript") + static final def STARTUP_SCRIPT_NAME_BASE = "honeycomb-memory-footprint-benchmark-" + + static final def FOOTPRINT_TEST_CLASS = "io.fd.honeycomb.benchmark.memory.HoneycombFootprintTest" + + static final def OUTPUT_PATH_PARAM = "-DoutPath=\$(dirname \$0)/" + static final def SAMPLE_SIZE_PARAM = "-DsampleSize=" + + /** + * Generate script to run io.fd.honeycomb.benchmark.memory.HoneycombWithDataTest with provided params + * */ + public static void generateWithDataScript(project, log, String outputFileName, dataSampleSize) { + log.info "Binding execution script for with-data benchmark[output=${outputFileName},sampleSize=${dataSampleSize}]" + def scriptContent = new SimpleTemplateEngine().createTemplate(STARTUP_SCRIPT_ON_REST_TEMPLATE).make( + [ + "testParams" : "${OUTPUT_PATH_PARAM}${outputFileName}-${dataSampleSize} ${SAMPLE_SIZE_PARAM}${dataSampleSize}", + "testClass" : FOOTPRINT_TEST_CLASS + ]).toString() + flushScript(Paths.get(project.build.directory, "${STARTUP_SCRIPT_NAME_BASE}${dataSampleSize}"), scriptContent, log) + } + + private static flushScript(filePath, content,log) { + log.info "Saving script to path ${filePath}" + def file = Files.createFile(filePath).toFile() + + file.text = content + file.setExecutable(true) + } +} diff --git a/infra/it/memory-benchmark-scripts/src/main/resources/memoryBenchmarkScript b/infra/it/memory-benchmark-scripts/src/main/resources/memoryBenchmarkScript new file mode 100644 index 000000000..120cb00e0 --- /dev/null +++ b/infra/it/memory-benchmark-scripts/src/main/resources/memoryBenchmarkScript @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +java -cp .:memory-benchmark-1.0.0-with-tests.jar ${testParams} org.junit.runner.JUnitCore ${testClass} \ No newline at end of file -- cgit 1.2.3-korg