@Component public class ExecutionSynchronizer extends Object
After query/benchmark is finished we should wait at least 2 resolutions before we execute next query/benchmark, so runs does not interfere with each other.
Graphite metrics loading should be delayed at least 1 resolution to make sure that last probe was stored in graphite.
| Constructor and Description |
|---|
ExecutionSynchronizer() |
| Modifier and Type | Method and Description |
|---|---|
void |
awaitAfterBenchmarkExecutionAndBeforeResultReport(Benchmark benchmark)
If metrics collection is enabled and we are doing concurrent benchmark, we should wait
between benchmarks, so measurements are accurate.
|
void |
awaitAfterQueryExecutionAndBeforeResultReport(QueryExecutionResult queryExecutionResult)
If metrics collection is enabled and we are doing serial benchmark, we should wait
between queries, so measurements are accurate.
|
<T> CompletableFuture<T> |
execute(Instant when,
Callable<T> callable)
Executes
callable when time comes. |
void |
shutdown() |
@PreDestroy public void shutdown() throws InterruptedException
InterruptedExceptionpublic void awaitAfterQueryExecutionAndBeforeResultReport(QueryExecutionResult queryExecutionResult)
public void awaitAfterBenchmarkExecutionAndBeforeResultReport(Benchmark benchmark)
public <T> CompletableFuture<T> execute(Instant when, Callable<T> callable)
callable when time comes. The callable gets executed immediately, without
offloading to a backghround thread, if execution time requested has already passed.Copyright © 2015–2020. All rights reserved.