Apache DataFusion SQL Query Engine
ARROW-12330: [Developer] Restore values at counters column of Archery benchmark
Kazuaki Ishizaki6e537e6da8fd
diff --git a/dev/archery/archery/benchmark/codec.py b/dev/archery/archery/benchmark/codec.pyindex 359dea9b9f..4157890d13 100644--- a/dev/archery/archery/benchmark/codec.py+++ b/dev/archery/archery/benchmark/codec.py@@ -50,6 +50,7 @@ class BenchmarkCodec:"values": b.values,"time_unit": b.time_unit,"times": b.times,+ "counters": b.counters,}@staticmethoddiff --git a/dev/archery/archery/benchmark/google.py b/dev/archery/archery/benchmark/google.pyindex c1644dcbd9..ebcc526364 100644--- a/dev/archery/archery/benchmark/google.py+++ b/dev/archery/archery/benchmark/google.py@@ -157,8 +157,9 @@ class GoogleBenchmark(Benchmark):values = [b.value for b in self.runs]times = [b.real_time for b in self.runs]# Slight kludge to extract the UserCounters for each benchmark- self.counters = self.runs[0].counters- super().__init__(name, unit, less_is_better, values, time_unit, times)+ counters = self.runs[0].counters+ super().__init__(name, unit, less_is_better, values, time_unit, times,+ counters)def __repr__(self):return "GoogleBenchmark[name={},runs={}]".format(self.names, self.runs)diff --git a/dev/archery/archery/tests/test_benchmarks.py b/dev/archery/archery/tests/test_benchmarks.pyindex dffe698d41..fab1e8d443 100644--- a/dev/archery/archery/tests/test_benchmarks.py+++ b/dev/archery/archery/tests/test_benchmarks.py@@ -152,6 +152,12 @@ def test_items_per_second():"time_unit": "ns",}archery_result = {+ "counters": {"iterations": 5964,+ "null_percent": 0.0,+ "repetition_index": 0,+ "repetitions": 0,+ "run_name": name,+ "threads": 1},"name": name,"unit": "items_per_second","less_is_better": False,@@ -180,6 +186,11 @@ def test_bytes_per_second():"time_unit": "ns",}archery_result = {+ "counters": {"iterations": 47,+ "repetition_index": 1,+ "repetitions": 0,+ "run_name": name,+ "threads": 1},"name": name,"unit": "bytes_per_second","less_is_better": False,@@ -212,6 +223,12 @@ def test_both_items_and_bytes_per_second():}# Note that bytes_per_second trumps items_per_secondarchery_result = {+ "counters": {"iterations": 5964,+ "null_percent": 0.0,+ "repetition_index": 0,+ "repetitions": 0,+ "run_name": name,+ "threads": 1},"name": name,"unit": "bytes_per_second","less_is_better": False,@@ -239,6 +256,11 @@ def test_neither_items_nor_bytes_per_second():"time_unit": "ns",}archery_result = {+ "counters": {"iterations": 352765,+ "repetition_index": 0,+ "repetitions": 0,+ "run_name": name,+ "threads": 1},"name": name,"unit": "ns","less_is_better": True,@@ -266,6 +288,11 @@ def test_prefer_real_time():"time_unit": "ns",}archery_result = {+ "counters": {"iterations": 352765,+ "repetition_index": 0,+ "repetitions": 0,+ "run_name": name,+ "threads": 1},"name": name,"unit": "ns","less_is_better": True,@@ -292,6 +319,11 @@ def test_prefer_cpu_time():"time_unit": "ns",}archery_result = {+ "counters": {"iterations": 352765,+ "repetition_index": 0,+ "repetitions": 0,+ "run_name": name,+ "threads": 1},"name": name,"unit": "ns","less_is_better": True,@@ -330,6 +362,11 @@ def test_omits_aggregates():"time_unit": "ns",}archery_result = {+ "counters": {"iterations": 352765,+ "repetition_index": 0,+ "repetitions": 0,+ "run_name": name,+ "threads": 1},"name": name,"unit": "ns","less_is_better": True,