@@ -0,0 +1,2543 @@
+/*%0A * Licensed to CRATE Technology GmbH (%22Crate%22) under one or more contributor%0A * license agreements.  See the NOTICE file distributed with this work for%0A * additional information regarding copyright ownership.  Crate licenses%0A * this file to you under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.  You may%0A * obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS, WITHOUT%0A * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the%0A * License for the specific language governing permissions and limitations%0A * under the License.%0A *%0A * However, if you have executed another commercial license agreement%0A * with Crate these terms will supersede the license and you may use the%0A * software solely pursuant to the terms of the relevant commercial agreement.%0A */%0A%0Apackage io.crate.benchmark;%0A%0Aimport com.carrotsearch.junitbenchmarks.BenchmarkRule;%0Aimport com.carrotsearch.junitbenchmarks.annotation.AxisRange;%0Aimport com.carrotsearch.junitbenchmarks.annotation.BenchmarkHistoryChart;%0Aimport com.carrotsearch.junitbenchmarks.annotation.BenchmarkMethodChart;%0Aimport com.carrotsearch.junitbenchmarks.annotation.LabelType;%0Aimport org.elasticsearch.action.count.CountAction;%0Aimport org.elasticsearch.action.count.CountRequest;%0Aimport org.junit.Rule;%0Aimport org.junit.Test;%0Aimport org.junit.rules.RuleChain;%0Aimport org.junit.rules.TestRule;%0A%0A@AxisRange(min = 0)%0A@BenchmarkHistoryChart(filePrefix=%22benchmark-count-history%22, labelWith = LabelType.CUSTOM_KEY)%0A@BenchmarkMethodChart(filePrefix = %22benchmark-count%22)%0Apublic class CountBenchmark extends BenchmarkBase %7B%0A%0A    public static final int NUM_REQUESTS_PER_TEST = 200;%0A    public static final int BENCHMARK_ROUNDS = 100;%0A%0A    @Rule%0A    public TestRule benchmarkRun = RuleChain.outerRule(new BenchmarkRule()).around(super.ruleChain);%0A%0A    @Override%0A    public boolean importData() %7B%0A        return true;%0A    %7D%0A%0A    @Test%0A    public void testESCount() throws Exception %7B%0A        for (int i = 0; i %3C NUM_REQUESTS_PER_TEST; i++) %7B%0A            getClient(false).execute(CountAction.INSTANCE, new CountRequest(%22countries%22)).actionGet();%0A        %7D%0A    %7D%0A%0A    @Test%0A    public void testSQLCount() throws Exception %7B%0A        for (int i = 0; i %3C NUM_REQUESTS_PER_TEST; i++) %7B%0A            execute(%22select count(*) from countries%22);%0A        %7D%0A    %7D%0A%7D%0A

add a count(*) benchmark