Class QueryRunner
- java.lang.Object
-
- org.apache.pinot.tools.AbstractBaseCommand
-
- org.apache.pinot.tools.perf.QueryRunner
-
public class QueryRunner extends AbstractBaseCommand implements Command
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classQueryRunner.QuerySummary
-
Field Summary
-
Fields inherited from class org.apache.pinot.tools.AbstractBaseCommand
DEFAULT_CLUSTER_NAME, DEFAULT_ZK_ADDRESS
-
-
Constructor Summary
Constructors Constructor Description QueryRunner()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringdescription()booleanexecute()booleangetHelp()StringgetName()static QueryRunner.QuerySummaryincreasingQPSQueryRunner(PerfBenchmarkDriverConf conf, List<String> queries, int numTimesToRunQueries, int numThreads, int queueDepth, double startQPS, double deltaQPS, int reportIntervalMs, int numIntervalsToReportAndClearStatistics, int numIntervalsToIncreaseQPS, long timeout)static QueryRunner.QuerySummaryincreasingQPSQueryRunner(PerfBenchmarkDriverConf conf, List<String> queries, int numTimesToRunQueries, int numThreads, int queueDepth, double startQPS, double deltaQPS, int reportIntervalMs, int numIntervalsToReportAndClearStatistics, int numIntervalsToIncreaseQPS, long timeout, Map<String,String> headers)Use multiple threads to run query at an increasing target QPS.static voidmain(String[] args)static QueryRunner.QuerySummarymultiThreadedQueryRunner(PerfBenchmarkDriverConf conf, List<String> queries, int numTimesToRunQueries, int numThreads, int queueDepth, int reportIntervalMs, int numIntervalsToReportAndClearStatistics, long timeout)static QueryRunner.QuerySummarymultiThreadedQueryRunner(PerfBenchmarkDriverConf conf, List<String> queries, int numTimesToRunQueries, int numThreads, int queueDepth, int reportIntervalMs, int numIntervalsToReportAndClearStatistics, long timeout, Map<String,String> headers)Use multiple threads to run queries as fast as possible.static QueryRunner.QuerySummarysingleThreadedQueryRunner(PerfBenchmarkDriverConf conf, List<String> queries, int numTimesToRunQueries, int reportIntervalMs, int numIntervalsToReportAndClearStatistics, long timeout)static QueryRunner.QuerySummarysingleThreadedQueryRunner(PerfBenchmarkDriverConf conf, List<String> queries, int numTimesToRunQueries, int reportIntervalMs, int numIntervalsToReportAndClearStatistics, long timeout, Map<String,String> headers)Use single thread to run queries as fast as possible.static QueryRunner.QuerySummarytargetQPSQueryRunner(PerfBenchmarkDriverConf conf, List<String> queries, int numTimesToRunQueries, int numThreads, int queueDepth, double startQPS, int reportIntervalMs, int numIntervalsToReportAndClearStatistics, long timeout)static QueryRunner.QuerySummarytargetQPSQueryRunner(PerfBenchmarkDriverConf conf, List<String> queries, int numTimesToRunQueries, int numThreads, int queueDepth, double startQPS, int reportIntervalMs, int numIntervalsToReportAndClearStatistics, long timeout, Map<String,String> headers)Use multiple threads to run query at a target QPS.-
Methods inherited from class org.apache.pinot.tools.AbstractBaseCommand
cleanup, printExamples, printUsage
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.pinot.tools.Command
call, printUsage
-
-
-
-
Method Detail
-
getName
public String getName()
- Overrides:
getNamein classAbstractBaseCommand
-
description
public String description()
- Specified by:
descriptionin interfaceCommand
-
execute
public boolean execute() throws Exception
-
singleThreadedQueryRunner
public static QueryRunner.QuerySummary singleThreadedQueryRunner(PerfBenchmarkDriverConf conf, List<String> queries, int numTimesToRunQueries, int reportIntervalMs, int numIntervalsToReportAndClearStatistics, long timeout) throws Exception
- Throws:
Exception
-
singleThreadedQueryRunner
public static QueryRunner.QuerySummary singleThreadedQueryRunner(PerfBenchmarkDriverConf conf, List<String> queries, int numTimesToRunQueries, int reportIntervalMs, int numIntervalsToReportAndClearStatistics, long timeout, Map<String,String> headers) throws Exception
Use single thread to run queries as fast as possible.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.
- Parameters:
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.headers- for the query request, e.g. to carry security token.- Returns:
- QuerySummary containing final report of query stats
- Throws:
Exception
-
multiThreadedQueryRunner
public static QueryRunner.QuerySummary multiThreadedQueryRunner(PerfBenchmarkDriverConf conf, List<String> queries, int numTimesToRunQueries, int numThreads, int queueDepth, int reportIntervalMs, int numIntervalsToReportAndClearStatistics, long timeout) throws Exception
- Throws:
Exception
-
multiThreadedQueryRunner
public static QueryRunner.QuerySummary multiThreadedQueryRunner(PerfBenchmarkDriverConf conf, List<String> queries, int numTimesToRunQueries, int numThreads, int queueDepth, int reportIntervalMs, int numIntervalsToReportAndClearStatistics, long timeout, Map<String,String> headers) throws Exception
Use multiple threads to run queries as fast as possible.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
numThreadsworker 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.
- Parameters:
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 queriesheaders- for the query request, e.g. to carry security token.- Returns:
- QuerySummary containing final report of query stats
- Throws:
Exception
-
targetQPSQueryRunner
public static QueryRunner.QuerySummary targetQPSQueryRunner(PerfBenchmarkDriverConf conf, List<String> queries, int numTimesToRunQueries, int numThreads, int queueDepth, double startQPS, int reportIntervalMs, int numIntervalsToReportAndClearStatistics, long timeout) throws Exception
- Throws:
Exception
-
targetQPSQueryRunner
public static QueryRunner.QuerySummary targetQPSQueryRunner(PerfBenchmarkDriverConf conf, List<String> queries, int numTimesToRunQueries, int numThreads, int queueDepth, double startQPS, int reportIntervalMs, int numIntervalsToReportAndClearStatistics, long timeout, Map<String,String> headers) throws Exception
Use multiple threads to run query at a target QPS.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
numThreadsworker 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.
- Parameters:
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 queriesheaders- for the query request, e.g. to carry security token.- Returns:
- QuerySummary containing final report of query stats
- Throws:
Exception
-
increasingQPSQueryRunner
public static QueryRunner.QuerySummary increasingQPSQueryRunner(PerfBenchmarkDriverConf conf, List<String> queries, int numTimesToRunQueries, int numThreads, int queueDepth, double startQPS, double deltaQPS, int reportIntervalMs, int numIntervalsToReportAndClearStatistics, int numIntervalsToIncreaseQPS, long timeout) throws Exception
- Throws:
Exception
-
increasingQPSQueryRunner
public static QueryRunner.QuerySummary increasingQPSQueryRunner(PerfBenchmarkDriverConf conf, List<String> queries, int numTimesToRunQueries, int numThreads, int queueDepth, double startQPS, double deltaQPS, int reportIntervalMs, int numIntervalsToReportAndClearStatistics, int numIntervalsToIncreaseQPS, long timeout, Map<String,String> headers) throws Exception
Use multiple threads to run query at an increasing target QPS.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
numThreadsworker 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.
- Parameters:
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.headers- for the query request, e.g. to carry security token.- Returns:
- QuerySummary containing final report of query stats
- Throws:
Exception
-
-