diff --git a/tests/jepsen.clickhouse-keeper/project.clj b/tests/jepsen.clickhouse-keeper/project.clj index f48faf21333..c38767a767d 100644 --- a/tests/jepsen.clickhouse-keeper/project.clj +++ b/tests/jepsen.clickhouse-keeper/project.clj @@ -9,6 +9,5 @@ :dependencies [[org.clojure/clojure "1.10.1"] [jepsen "0.2.3"] [zookeeper-clj "0.9.4"] - [me.raynes/conch "0.8.0"] [org.apache.zookeeper/zookeeper "3.6.1" :exclusions [org.slf4j/slf4j-log4j12]]] :repl-options {:init-ns jepsen.clickhouse-keeper.main}) diff --git a/tests/jepsen.clickhouse-keeper/src/jepsen/clickhouse_keeper/bench.clj b/tests/jepsen.clickhouse-keeper/src/jepsen/clickhouse_keeper/bench.clj new file mode 100644 index 00000000000..d1995705c51 --- /dev/null +++ b/tests/jepsen.clickhouse-keeper/src/jepsen/clickhouse_keeper/bench.clj @@ -0,0 +1,39 @@ +(ns jepsen.clickhouse-keeper.bench + (:require [clojure.tools.logging :refer :all] + [jepsen + [client :as client]]) + (:import (java.lang ProcessBuilder) + (java.lang ProcessBuilder$Redirect))) + +(defn exec-process-builder + [command & args] + (let [pbuilder (ProcessBuilder. (into-array (cons command args)))] + (.redirectOutput pbuilder ProcessBuilder$Redirect/INHERIT) + (.redirectError pbuilder ProcessBuilder$Redirect/INHERIT) + (let [p (.start pbuilder)] + (.waitFor p)))) + +(defrecord BenchClient [unused] + client/Client + (open! [this test node] + this) + + (setup! [this test] + this) + + (invoke! [this test op] + (let [bench-opts (into [] (clojure.string/split (:bench-opts op) #" ")) + bench-path (:bench-path op) + nodes (into [] (flatten (map (fn [x] (identity ["-h" (str x ":9181")])) (:nodes test)))) + all-args (concat [bench-path] bench-opts nodes)] + (info "Running cmd" all-args) + (apply exec-process-builder all-args) + (assoc op :type :ok :value "ok"))) + + (teardown! [_ test]) + + (close! [_ test])) + +(defn bench-client + [] + (BenchClient. nil)) diff --git a/utils/keeper-bench/Runner.cpp b/utils/keeper-bench/Runner.cpp index 3473cedd03c..d3f51fb2356 100644 --- a/utils/keeper-bench/Runner.cpp +++ b/utils/keeper-bench/Runner.cpp @@ -125,7 +125,10 @@ bool Runner::tryPushRequestInteractively(const Coordination::ZooKeeperRequestPtr void Runner::runBenchmark() { auto aux_connections = getConnections(); + + std::cerr << "Preparing to run\n"; generator->startup(*aux_connections[0]); + std::cerr << "Prepared\n"; try { for (size_t i = 0; i < concurrency; ++i)