You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by pt...@apache.org on 2016/07/28 16:05:40 UTC
[3/8] ignite git commit: Yardstick: improved method for quick
benchmark testing.
Yardstick: improved method for quick benchmark testing.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/c82acb76
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/c82acb76
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/c82acb76
Branch: refs/heads/master
Commit: c82acb769ef3fcdf1cbd75a429b837e35ed5a96b
Parents: 8386dd8
Author: sboikov <sb...@gridgain.com>
Authored: Thu Jul 28 14:14:44 2016 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Thu Jul 28 14:14:44 2016 +0300
----------------------------------------------------------------------
.../ignite/yardstick/IgniteBenchmarkUtils.java | 96 ++++++++++++--------
1 file changed, 60 insertions(+), 36 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/c82acb76/modules/yardstick/src/main/java/org/apache/ignite/yardstick/IgniteBenchmarkUtils.java
----------------------------------------------------------------------
diff --git a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/IgniteBenchmarkUtils.java b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/IgniteBenchmarkUtils.java
index af060d4..54ef00d 100644
--- a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/IgniteBenchmarkUtils.java
+++ b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/IgniteBenchmarkUtils.java
@@ -17,19 +17,22 @@
package org.apache.ignite.yardstick;
+import java.util.ArrayList;
+import java.util.List;
import java.util.concurrent.Callable;
import javax.cache.CacheException;
import org.apache.ignite.IgniteTransactions;
+import org.apache.ignite.Ignition;
import org.apache.ignite.cluster.ClusterTopologyException;
+import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.transactions.Transaction;
import org.apache.ignite.transactions.TransactionConcurrency;
import org.apache.ignite.transactions.TransactionIsolation;
import org.apache.ignite.transactions.TransactionOptimisticException;
import org.apache.ignite.transactions.TransactionRollbackException;
import org.apache.ignite.yardstick.cache.IgniteSqlQueryBenchmark;
-import org.apache.ignite.yardstick.cache.IgniteSqlQueryDistributedJoinBenchmark;
+import org.yardstickframework.BenchmarkDriver;
import org.yardstickframework.BenchmarkDriverStartUp;
-import org.yardstickframework.BenchmarkServerStartUp;
/**
* Utils.
@@ -47,7 +50,7 @@ public class IgniteBenchmarkUtils {
* @param txConcurrency Transaction concurrency.
* @param clo Closure.
* @return Result of closure execution.
- * @throws Exception
+ * @throws Exception If failed.
*/
public static <T> T doInTransaction(IgniteTransactions igniteTx, TransactionConcurrency txConcurrency,
TransactionIsolation txIsolation, Callable<T> clo) throws Exception {
@@ -77,44 +80,65 @@ public class IgniteBenchmarkUtils {
}
}
-// /**
-// * Starts driver for quick benchmarks testing.
-// *
-// * @param args Command line arguments.
-// * @throws Exception If failed.
-// */
-// public static void main(String[] args) throws Exception {
-// String[] args0 = {
-// "-t", "1",
-// "-w", "5",
-// "-d", "5",
-// "-dn", IgniteSqlQueryDistributedJoinBenchmark.class.getSimpleName(),
-// "-r", "100",
-// "-sn", "IgniteNode",
-// "-bcj",
-// "-cfg", "modules/yardstick/config/ignite-localhost-config.xml"};
-//
-// BenchmarkDriverStartUp.main(args0);
-// }
-
/**
- * Starts driver for quick benchmarks testing.
+ * Starts nodes/driver in single JVM for quick benchmarks testing.
*
* @param args Command line arguments.
* @throws Exception If failed.
*/
public static void main(String[] args) throws Exception {
- String[] args0 = {
- "-t", "15",
- "-w", "30",
- "-d", "60",
- "-cl",
- "-pr", "ThroughputLatencyProbe",
- "-dn", IgniteSqlQueryBenchmark.class.getSimpleName(),
- "-r", "100000",
- "-sn", "IgniteNode",
- "-cfg", "modules/yardstick/config/ignite-localhost-config.xml"};
-
- BenchmarkDriverStartUp.main(args0);
+ final String cfg = "modules/yardstick/config/ignite-localhost-config.xml";
+
+ final Class<? extends BenchmarkDriver> benchmark = IgniteSqlQueryBenchmark.class;
+
+ final int threads = 1;
+
+ final boolean clientDriverNode = true;
+
+ final int extraNodes = 2;
+
+ final int warmUp = 5;
+ final int duration = 5;
+
+ final int range = 100_000;
+
+ final boolean throughputLatencyProbe = false;
+
+ for (int i = 0; i < extraNodes; i++) {
+ IgniteConfiguration nodeCfg = Ignition.loadSpringBean(cfg, "grid.cfg");
+
+ nodeCfg.setGridName("node-" + i);
+ nodeCfg.setMetricsLogFrequency(0);
+
+ Ignition.start(nodeCfg);
+ }
+
+ ArrayList<String> args0 = new ArrayList<>();
+
+ addArg(args0, "-t", threads);
+ addArg(args0, "-w", warmUp);
+ addArg(args0, "-d", duration);
+ addArg(args0, "-r", range);
+ addArg(args0, "-dn", benchmark.getSimpleName());
+ addArg(args0, "-sn", "IgniteNode");
+ addArg(args0, "-cfg", cfg);
+
+ if (throughputLatencyProbe)
+ addArg(args0, "-pr", "ThroughputLatencyProbe");
+
+ if (clientDriverNode)
+ args0.add("-cl");
+
+ BenchmarkDriverStartUp.main(args0.toArray(new String[args0.size()]));
+ }
+
+ /**
+ * @param args Arguments.
+ * @param arg Argument name.
+ * @param val Argument value.
+ */
+ private static void addArg(List<String> args, String arg, Object val) {
+ args.add(arg);
+ args.add(val.toString());
}
}