public class QueryRunner extends AbstractBaseCommand implements Command
DEFAULT_CLUSTER_NAME, DEFAULT_ZK_ADDRESS| Constructor and Description |
|---|
QueryRunner() |
| Modifier and Type | Method and Description |
|---|---|
String |
description() |
boolean |
execute() |
boolean |
getHelp() |
String |
getName() |
static void |
increasingQPSQueryRunner(PerfBenchmarkDriverConf conf,
Stream<String> queries,
int numTimesToRunQueries,
int numThreads,
int queueDepth,
double startQPS,
double deltaQPS,
int reportIntervalMs,
int numIntervalsToReportAndClearStatistics,
int numIntervalsToIncreaseQPS,
long timeout)
Use multiple threads to run query at an increasing target QPS.
|
static void |
main(String[] args) |
static void |
multiThreadedQueryRunner(PerfBenchmarkDriverConf conf,
Stream<String> queries,
int numTimesToRunQueries,
int numThreads,
int queueDepth,
int reportIntervalMs,
int numIntervalsToReportAndClearStatistics,
long timeout)
Use multiple threads to run queries as fast as possible.
|
static void |
singleThreadedQueryRunner(PerfBenchmarkDriverConf conf,
Stream<String> queries,
int numTimesToRunQueries,
int reportIntervalMs,
int numIntervalsToReportAndClearStatistics,
long timeout)
Use single thread to run queries as fast as possible.
|
static void |
targetQPSQueryRunner(PerfBenchmarkDriverConf conf,
Stream<String> queries,
int numTimesToRunQueries,
int numThreads,
int queueDepth,
double startQPS,
int reportIntervalMs,
int numIntervalsToReportAndClearStatistics,
long timeout)
Use multiple threads to run query at a target QPS.
|
cleanup, printExamples, printUsageclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitprintUsagepublic String getName()
getName in class AbstractBaseCommandpublic String description()
description in interface Commandpublic boolean execute()
throws Exception
public static void singleThreadedQueryRunner(PerfBenchmarkDriverConf conf, Stream<String> queries, int numTimesToRunQueries, int reportIntervalMs, int numIntervalsToReportAndClearStatistics, long timeout) throws Exception
Use a single thread to send queries back to back and log statistic information periodically.
Queries are picked sequentially from the query file.
Query runner will stop when all queries in the query file has been executed number of times configured.
conf - perf benchmark driver config.queries - query stream.numTimesToRunQueries - number of times to run all queries in the query file, 0 means infinite times.reportIntervalMs - report interval in milliseconds.numIntervalsToReportAndClearStatistics - number of report intervals to report detailed statistics and clear
them, 0 means never.timeout - timeout in milliseconds for completing all queries.Exceptionpublic static void multiThreadedQueryRunner(PerfBenchmarkDriverConf conf, Stream<String> queries, int numTimesToRunQueries, int numThreads, int queueDepth, int reportIntervalMs, int numIntervalsToReportAndClearStatistics, long timeout) throws Exception
Use a concurrent linked queue to buffer the queries to be sent. Use the main thread to insert queries into the
queue whenever the queue length is low, and start numThreads worker threads to fetch queries from the
queue and send them.
The main thread is responsible for collecting and logging the statistic information periodically.
Queries are picked sequentially from the query file.
Query runner will stop when all queries in the query file has been executed number of times configured.
conf - perf benchmark driver config.queries - query stream.numTimesToRunQueries - number of times to run all queries in the query file, 0 means infinite times.numThreads - number of threads sending queries.queueDepth - queue size limit for query generatorreportIntervalMs - report interval in milliseconds.numIntervalsToReportAndClearStatistics - number of report intervals to report detailed statistics and clear
them, 0 means never.timeout - timeout in milliseconds for completing all queriesExceptionpublic static void targetQPSQueryRunner(PerfBenchmarkDriverConf conf, Stream<String> queries, int numTimesToRunQueries, int numThreads, int queueDepth, double startQPS, int reportIntervalMs, int numIntervalsToReportAndClearStatistics, long timeout) throws Exception
Use a concurrent linked queue to buffer the queries to be sent. Use the main thread to insert queries into the
queue at the target QPS, and start numThreads worker threads to fetch queries from the queue and send
them.
The main thread is responsible for collecting and logging the statistic information periodically.
Queries are picked sequentially from the query file.
Query runner will stop when all queries in the query file has been executed number of times configured.
conf - perf benchmark driver config.queries - query stream.numTimesToRunQueries - number of times to run all queries in the query file, 0 means infinite times.numThreads - number of threads sending queries.queueDepth - queue size limit for query generatorstartQPS - start QPS (target QPS).reportIntervalMs - report interval in milliseconds.numIntervalsToReportAndClearStatistics - number of report intervals to report detailed statistics and clear
them, 0 means never.timeout - timeout in milliseconds for completing all queriesExceptionpublic static void increasingQPSQueryRunner(PerfBenchmarkDriverConf conf, Stream<String> queries, int numTimesToRunQueries, int numThreads, int queueDepth, double startQPS, double deltaQPS, int reportIntervalMs, int numIntervalsToReportAndClearStatistics, int numIntervalsToIncreaseQPS, long timeout) throws Exception
Use a concurrent linked queue to buffer the queries to be sent. Use the main thread to insert queries into the
queue at the target QPS, and start numThreads worker threads to fetch queries from the queue and send
them.
We start with the start QPS, and keep adding delta QPS to the start QPS during the test.
The main thread is responsible for collecting and logging the statistic information periodically.
Queries are picked sequentially from the query file.
Query runner will stop when all queries in the query file has been executed number of times configured.
conf - perf benchmark driver config.queries - query stream.numTimesToRunQueries - number of times to run all queries in the query file, 0 means infinite times.numThreads - number of threads sending queries.queueDepth - queue size limit for query generatorstartQPS - start QPS.deltaQPS - delta QPS.reportIntervalMs - report interval in milliseconds.numIntervalsToReportAndClearStatistics - number of report intervals to report detailed statistics and clear
them, 0 means never.timeout - timeout in milliseconds for completing all queries.numIntervalsToIncreaseQPS - number of intervals to increase QPS.ExceptionCopyright © 2018–2020 Apache Software Foundation. All rights reserved.