Class ExecutionSynchronizer

java.lang.Object
io.trino.benchto.driver.execution.ExecutionSynchronizer

@Component public class ExecutionSynchronizer extends Object
This class is responsible for synchronizing threads in driver if graphite metrics collection is enabled. Graphite collects metrics with predefined resolution, ex. 10 s.

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 Details

    • ExecutionSynchronizer

      public ExecutionSynchronizer()
  • Method Details

    • shutdown

      @PreDestroy public void shutdown() throws InterruptedException
      Throws:
      InterruptedException
    • awaitAfterQueryExecutionAndBeforeResultReport

      public void awaitAfterQueryExecutionAndBeforeResultReport(QueryExecutionResult queryExecutionResult)
      If metrics collection is enabled and we are doing serial benchmark, we should wait between queries, so measurements are accurate.
    • awaitAfterBenchmarkExecutionAndBeforeResultReport

      public void awaitAfterBenchmarkExecutionAndBeforeResultReport(Benchmark benchmark)
      If metrics collection is enabled and we are doing concurrent benchmark, we should wait between benchmarks, so measurements are accurate.
    • execute

      public <T> CompletableFuture<T> execute(java.time.Instant when, Callable<T> callable)
      Executes callable when time comes. The callable gets executed immediately, without offloading to a backghround thread, if execution time requested has already passed.