Skip to content

Microbenchmarks based on Caliper are broken #2432

@turu

Description

@turu

All microbenchmarks using Google Caliper library are broken. They cannot execute properly due to dependency version mismatch. The root cause is that Druid declares dependency on com.google.guava:guava:16.0.1 and com.google.caliper:caliper:0.5-rc1. Caliper in turn, needs Guava in version < 16.0, because it uses http://docs.guava-libraries.googlecode.com/git-history/v15.0/javadoc/com/google/common/io/Closeables.html#closeQuietly(java.io.Closeable) internally.

Affected benchmarks:

  1. JavaScriptAggregatorBenchmark
  2. CardinalityAggregatorBenchmark
  3. HyperLogLogCollectorBenchmark
  4. TopNBinaryFnBenchmark
  5. MemcachedCacheBenchmark

Steps to reproduce:

  1. Checkout current master
  2. Attempt to run any of the affected benchmarks.

Expected result:

  1. Benchmark completes successfully

Actual result:

Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.io.Closeables.closeQuietly(Ljava/io/Closeable;)V
    at com.google.caliper.Runner.measure(Runner.java:301)
    at com.google.caliper.Runner.runScenario(Runner.java:229)
    at com.google.caliper.Runner.runOutOfProcess(Runner.java:378)
    at com.google.caliper.Runner.run(Runner.java:97)
    at com.google.caliper.Runner.main(Runner.java:423)
    at com.google.caliper.Runner.main(Runner.java:436)
    at io.druid.query.aggregation.hyperloglog.HyperLogLogCollectorBenchmark.main(HyperLogLogCollectorBenchmark.java:167)

How to fix:
There are two ways this can be fixed.

  1. Lower version of Guava dependency to 15.0 globally.
  2. Bump up Caliper dependency to the newest 1.0-beta-2 and migrate affected benchmarks to the new API (there have been some API changes between 0.5-rc1 and 1.0-beta-1).

I will try to open a pull request fixing this today.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions