Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/benchmark-drivers-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ do

now=`date +'%H%M%S'`

cfg="${outFol} ${host_name0} ${CONFIG}"
cfg="${outFol} ${host_name0} -id ${cntr} ${CONFIG}"

suffix=`echo "${cfg}" | tail -c 60 | sed 's/ *$//g'`

Expand Down
2 changes: 1 addition & 1 deletion bin/benchmark-manual-drivers-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ for cfg in "${configs0[@]}";
do
now=`date +'%H%M%S'`

cfgParams="${OUTPUT_FOLDER} ${cfg}"
cfgParams="${OUTPUT_FOLDER} -id ${cntr} ${cfg}"

suffix=`echo "${cfgParams}" | tail -c 60 | sed 's/ *$//g'`

Expand Down
4 changes: 3 additions & 1 deletion bin/benchmark-manual-servers-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ CUR_DIR=$(pwd)

for i in $(eval echo {1..$SERVER_NODES});
do
CONFIG_PRM="-id ${cntr} ${CONFIG}"

suffix=`echo "${CONFIG}" | tail -c 60 | sed 's/ *$//g'`

file_log=${LOGS_DIR}"/"${i}"_server.log"
Expand All @@ -131,5 +133,5 @@ do

MAIN_CLASS=org.yardstickframework.BenchmarkServerStartUp JVM_OPTS=${JVM_OPTS} CP=${CP} \
CUR_DIR=${CUR_DIR} PROPS_ENV0=${PROPS_ENV} \
nohup ${SCRIPT_DIR}/benchmark-bootstrap.sh ${CONFIG} --config ${CONFIG_INCLUDE} > ${file_log} 2>& 1 &
nohup ${SCRIPT_DIR}/benchmark-bootstrap.sh ${CONFIG_PRM} --config ${CONFIG_INCLUDE} > ${file_log} 2>& 1 &
done
4 changes: 3 additions & 1 deletion bin/benchmark-servers-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ cntr=0
IFS=',' read -ra hosts0 <<< "${SERVER_HOSTS}"
for host_name in "${hosts0[@]}";
do
CONFIG_PRM="-id ${cntr} ${CONFIG}"

suffix=`echo "${CONFIG}" | tail -c 60 | sed 's/ *$//g'`

echo "<"$(date +"%H:%M:%S")"><yardstick> Starting server config '..."${suffix}"' on "${host_name}""
Expand All @@ -119,7 +121,7 @@ do
ssh -o PasswordAuthentication=no ${REMOTE_USER}"@"${host_name} \
"MAIN_CLASS='org.yardstickframework.BenchmarkServerStartUp'" "JVM_OPTS='${JVM_OPTS}'" "CP='${CP}'" \
"CUR_DIR='${CUR_DIR}'" "PROPS_ENV0='${PROPS_ENV}'" \
"nohup ${SCRIPT_DIR}/benchmark-bootstrap.sh ${CONFIG} "--config" ${CONFIG_INCLUDE} > ${file_log} 2>& 1 &"
"nohup ${SCRIPT_DIR}/benchmark-bootstrap.sh ${CONFIG_PRM} "--config" ${CONFIG_INCLUDE} > ${file_log} 2>& 1 &"

cntr=$((1 + $cntr))
done
11 changes: 11 additions & 0 deletions src/main/java/org/yardstickframework/BenchmarkConfiguration.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ public class BenchmarkConfiguration {
@Parameter(names = {"-sn", "--serverName"}, description = "Benchmark server name (required)")
private String serverName;

/** */
@Parameter(names = {"-id", "--memberId"}, description = "Memebr ID")
private int memberId = 0;

/** */
@Parameter(names = {"-p", "--packages"}, description = "Comma separated list of packages for benchmarks")
private List<String> packages = Collections.emptyList();
Expand Down Expand Up @@ -130,6 +134,13 @@ public List<String> driverNames() {
return driverNames;
}

/**
* @return Member ID unique to server or driver.
*/
public int memberId() {
return memberId;
}

/**
* @return List of packages to load benchmarks from.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

package org.yardstickframework.examples.echo;

import static org.yardstickframework.BenchmarkUtils.println;

import org.yardstickframework.*;

import java.io.*;
Expand All @@ -38,7 +40,9 @@ public class EchoBenchmark extends BenchmarkDriverAdapter {
/** {@inheritDoc} */
@Override public void setUp(BenchmarkConfiguration cfg) throws Exception {
super.setUp(cfg);


println("Configuring driver id=" + cfg.memberId());

BenchmarkUtils.jcommander(cfg.commandLineArguments(), args, "<echo-driver>");

// Check if EchoServer is up.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ public class EchoServer implements BenchmarkServer {
/** {@inheritDoc} */
@Override public void start(final BenchmarkConfiguration cfg) throws Exception {
BenchmarkUtils.jcommander(cfg.commandLineArguments(), args, "<echo-server>");


println("Configuring server id=" + cfg.memberId());

th = new Thread(new Runnable() {
@Override public void run() {
try (ServerSocket srvrSock = newServerSocket(args)) {
Expand Down