From 0c995585ad866e74105772ea5b4d2757ed85ba74 Mon Sep 17 00:00:00 2001 From: k1LoW Date: Wed, 6 Sep 2023 07:38:15 +0900 Subject: [PATCH] bonsai --- report/custom_test.go | 28 +++++++++---------- report/report_test.go | 20 ++++++------- testdata/custom_metrics/benchmark_0.json | 12 ++++---- testdata/custom_metrics/benchmark_0_1.json | 24 ++++++++-------- testdata/custom_metrics/benchmark_1.json | 12 ++++---- .../custom_metric_set_out.1.golden | 8 +++--- .../custom_metric_set_out.2.golden | 8 +++--- .../custom_metric_set_table.1.golden | 6 ++-- .../custom_metric_set_table.2.golden | 6 ++-- .../diff_custom_metric_set_table.0.golden | 6 ++-- .../diff_custom_metric_set_table.1.golden | 8 +++--- 11 files changed, 69 insertions(+), 69 deletions(-) diff --git a/report/custom_test.go b/report/custom_test.go index 839923e4..9d6314b0 100644 --- a/report/custom_test.go +++ b/report/custom_test.go @@ -19,16 +19,16 @@ func TestCustomMetricSetTable(t *testing.T) { Key: "benchmark_0", Name: "Benchmark-0", Metrics: []*CustomMetric{ - {Key: "count", Name: "Count", Value: 1000.0, Unit: ""}, - {Key: "ns_per_op", Name: "ns/op", Value: 676.0, Unit: "ns/op"}, + {Key: "N", Name: "Number of iterations", Value: 1000.0, Unit: ""}, + {Key: "NsPerOp", Name: "Nanoseconds per iteration", Value: 676.5, Unit: " ns/op"}, }, }}, {&CustomMetricSet{ Key: "benchmark_1", Name: "Benchmark-1", Metrics: []*CustomMetric{ - {Key: "count", Name: "Count", Value: 1500.0, Unit: ""}, - {Key: "ns_per_op", Name: "ns/op", Value: 1340.0, Unit: "ns/op"}, + {Key: "N", Name: "Number of iterations", Value: 1500.0, Unit: ""}, + {Key: "NsPerOp", Name: "Nanoseconds per iteration", Value: 1340.0, Unit: " ns/op"}, }, }}, } @@ -56,8 +56,8 @@ func TestCustomMetricSetOut(t *testing.T) { Key: "benchmark_0", Name: "Benchmark-0", Metrics: []*CustomMetric{ - {Key: "count", Name: "Count", Value: 1000.0, Unit: ""}, - {Key: "ns_per_op", Name: "ns/op", Value: 676.0, Unit: "ns/op"}, + {Key: "N", Name: "Number of iterations", Value: 1000.0, Unit: ""}, + {Key: "NsPerOp", Name: "Nanoseconds per iteration", Value: 676.5, Unit: " ns/op"}, }, report: &Report{ Ref: "main", @@ -69,8 +69,8 @@ func TestCustomMetricSetOut(t *testing.T) { Key: "benchmark_1", Name: "Benchmark-1", Metrics: []*CustomMetric{ - {Key: "count", Name: "Count", Value: 1500.0, Unit: ""}, - {Key: "ns_per_op", Name: "ns/op", Value: 1340.0, Unit: "ns/op"}, + {Key: "N", Name: "Number of iterations", Value: 1500.0, Unit: ""}, + {Key: "NsPerOp", Name: "Nanoseconds per iteration", Value: 1340.0, Unit: " ns/op"}, }, report: &Report{ Ref: "main", @@ -140,8 +140,8 @@ func TestDiffCustomMetricSetTable(t *testing.T) { Key: "benchmark_0", Name: "Benchmark-0", Metrics: []*CustomMetric{ - {Key: "count", Name: "Count", Value: 1000.0, Unit: ""}, - {Key: "ns_per_op", Name: "ns/op", Value: 676.0, Unit: "ns/op"}, + {Key: "N", Name: "Number of iterations", Value: 1000.0, Unit: ""}, + {Key: "NsPerOp", Name: "Nanoseconds per iteration", Value: 676.5, Unit: " ns/op"}, }, report: &Report{ Ref: "main", @@ -156,8 +156,8 @@ func TestDiffCustomMetricSetTable(t *testing.T) { Key: "benchmark_0", Name: "Benchmark-0", Metrics: []*CustomMetric{ - {Key: "count", Name: "Count", Value: 1000.0, Unit: ""}, - {Key: "ns_per_op", Name: "ns/op", Value: 676.0, Unit: "ns/op"}, + {Key: "N", Name: "Number of iterations", Value: 1000.0, Unit: ""}, + {Key: "NsPerOp", Name: "Nanoseconds per iteration", Value: 676.5, Unit: " ns/op"}, }, report: &Report{ Ref: "main", @@ -169,8 +169,8 @@ func TestDiffCustomMetricSetTable(t *testing.T) { Key: "benchmark_0", Name: "Benchmark-0", Metrics: []*CustomMetric{ - {Key: "count", Name: "Count", Value: 9393.0, Unit: ""}, - {Key: "ns_per_op", Name: "ns/op", Value: 456.0, Unit: "ns/op"}, + {Key: "N", Name: "Number of iterations", Value: 9393.0, Unit: ""}, + {Key: "NsPerOp", Name: "Nanoseconds per iteration", Value: 456.0, Unit: " ns/op"}, }, report: &Report{ Ref: "main", diff --git a/report/report_test.go b/report/report_test.go index c497b805..00f901e4 100644 --- a/report/report_test.go +++ b/report/report_test.go @@ -116,8 +116,8 @@ func TestCollectCustomMetrics(t *testing.T) { Key: "benchmark_0", Name: "Benchmark-0 (this is custom metrics test)", Metrics: []*CustomMetric{ - {Key: "count", Name: "Count", Value: 1000.0, Unit: ""}, - {Key: "ns_per_op", Name: "ns/op", Value: 676.0, Unit: "ns/op"}, + {Key: "N", Name: "Number of iterations", Value: 1000.0, Unit: ""}, + {Key: "NsPerOp", Name: "Nanoseconds per iteration", Value: 676.5, Unit: " ns/op"}, }, }, }, @@ -133,16 +133,16 @@ func TestCollectCustomMetrics(t *testing.T) { Key: "benchmark_0", Name: "Benchmark-0 (this is custom metrics test)", Metrics: []*CustomMetric{ - {Key: "count", Name: "Count", Value: 1000.0, Unit: ""}, - {Key: "ns_per_op", Name: "ns/op", Value: 676.0, Unit: "ns/op"}, + {Key: "N", Name: "Number of iterations", Value: 1000.0, Unit: ""}, + {Key: "NsPerOp", Name: "Nanoseconds per iteration", Value: 676.5, Unit: " ns/op"}, }, }, { Key: "benchmark_1", Name: "Benchmark-1 (this is custom metrics test)", Metrics: []*CustomMetric{ - {Key: "count", Name: "Count", Value: 1500.0, Unit: ""}, - {Key: "ns_per_op", Name: "ns/op", Value: 1340.0, Unit: "ns/op"}, + {Key: "N", Name: "Number of iterations", Value: 1500.0, Unit: ""}, + {Key: "NsPerOp", Name: "Nanoseconds per iteration", Value: 1345.0, Unit: " ns/op"}, }, }, }, @@ -157,16 +157,16 @@ func TestCollectCustomMetrics(t *testing.T) { Key: "benchmark_0", Name: "Benchmark-0 (this is custom metrics test)", Metrics: []*CustomMetric{ - {Key: "count", Name: "Count", Value: 1000.0, Unit: ""}, - {Key: "ns_per_op", Name: "ns/op", Value: 676.0, Unit: "ns/op"}, + {Key: "N", Name: "Number of iterations", Value: 1000.0, Unit: ""}, + {Key: "NsPerOp", Name: "Nanoseconds per iteration", Value: 676.5, Unit: " ns/op"}, }, }, { Key: "benchmark_1", Name: "Benchmark-1 (this is custom metrics test)", Metrics: []*CustomMetric{ - {Key: "count", Name: "Count", Value: 1500.0, Unit: ""}, - {Key: "ns_per_op", Name: "ns/op", Value: 1340.0, Unit: "ns/op"}, + {Key: "N", Name: "Number of iterations", Value: 1500.0, Unit: ""}, + {Key: "NsPerOp", Name: "Nanoseconds per iteration", Value: 1345.0, Unit: " ns/op"}, }, }, }, diff --git a/testdata/custom_metrics/benchmark_0.json b/testdata/custom_metrics/benchmark_0.json index 52abe25c..aeaf86c3 100755 --- a/testdata/custom_metrics/benchmark_0.json +++ b/testdata/custom_metrics/benchmark_0.json @@ -3,15 +3,15 @@ "name": "Benchmark-0 (this is custom metrics test)", "metrics": [ { - "key": "count", - "name": "Count", + "key": "N", + "name": "Number of iterations", "value": 1000 }, { - "key": "ns_per_op", - "name": "ns/op", - "value": 676, - "unit": "ns/op" + "key": "NsPerOp", + "name": "Nanoseconds per iteration", + "value": 676.5, + "unit": " ns/op" } ] } \ No newline at end of file diff --git a/testdata/custom_metrics/benchmark_0_1.json b/testdata/custom_metrics/benchmark_0_1.json index be9ff732..b03eafa8 100644 --- a/testdata/custom_metrics/benchmark_0_1.json +++ b/testdata/custom_metrics/benchmark_0_1.json @@ -4,15 +4,15 @@ "name": "Benchmark-0 (this is custom metrics test)", "metrics": [ { - "key": "count", - "name": "Count", + "key": "N", + "name": "Number of iterations", "value": 1000 }, { - "key": "ns_per_op", - "name": "ns/op", - "value": 676, - "unit": "ns/op" + "key": "NsPerOp", + "name": "Nanoseconds per iteration", + "value": 676.5, + "unit": " ns/op" } ] }, @@ -21,15 +21,15 @@ "name": "Benchmark-1 (this is custom metrics test)", "metrics": [ { - "key": "count", - "name": "Count", + "key": "N", + "name": "Number of iterations", "value": 1500 }, { - "key": "ns_per_op", - "name": "ns/op", - "value": 1340, - "unit": "ns/op" + "key": "NsPerOp", + "name": "Nanoseconds per iteration", + "value": 1345, + "unit": " ns/op" } ] } diff --git a/testdata/custom_metrics/benchmark_1.json b/testdata/custom_metrics/benchmark_1.json index 9bf1b23a..e896c9d5 100755 --- a/testdata/custom_metrics/benchmark_1.json +++ b/testdata/custom_metrics/benchmark_1.json @@ -3,15 +3,15 @@ "name": "Benchmark-1 (this is custom metrics test)", "metrics": [ { - "key": "count", - "name": "Count", + "key": "N", + "name": "Number of iterations", "value": 1500 }, { - "key": "ns_per_op", - "name": "ns/op", - "value": 1340, - "unit": "ns/op" + "key": "NsPerOp", + "name": "Nanoseconds per iteration", + "value": 1345, + "unit": " ns/op" } ] } \ No newline at end of file diff --git a/testdata/custom_metrics/custom_metric_set_out.1.golden b/testdata/custom_metrics/custom_metric_set_out.1.golden index c6b87810..51826c74 100644 --- a/testdata/custom_metrics/custom_metric_set_out.1.golden +++ b/testdata/custom_metrics/custom_metric_set_out.1.golden @@ -1,4 +1,4 @@ - Benchmark-0 main (1234567) -------------------------------- - Count 1000 - ns/op 676ns/op +  Benchmark-0  main (1234567) +--------------------------------------------- + Number of iterations 1000 + Nanoseconds per iteration 676.5 ns/op diff --git a/testdata/custom_metrics/custom_metric_set_out.2.golden b/testdata/custom_metrics/custom_metric_set_out.2.golden index 5d71de81..4c953b44 100644 --- a/testdata/custom_metrics/custom_metric_set_out.2.golden +++ b/testdata/custom_metrics/custom_metric_set_out.2.golden @@ -1,4 +1,4 @@ - Benchmark-1 main (1234567) -------------------------------- - Count 1500 - ns/op 1340ns/op +  Benchmark-1  main (1234567) +--------------------------------------------- + Number of iterations 1500 + Nanoseconds per iteration 1340 ns/op diff --git a/testdata/custom_metrics/custom_metric_set_table.1.golden b/testdata/custom_metrics/custom_metric_set_table.1.golden index 9469d3a1..f06e0e32 100644 --- a/testdata/custom_metrics/custom_metric_set_table.1.golden +++ b/testdata/custom_metrics/custom_metric_set_table.1.golden @@ -1,5 +1,5 @@ ## Benchmark-0 -| Count | ns/op | -|------:|---------:| -| 1000 | 676ns/op | +| Number of iterations | Nanoseconds per iteration | +|---------------------:|--------------------------:| +| 1000 | 676.5 ns/op | diff --git a/testdata/custom_metrics/custom_metric_set_table.2.golden b/testdata/custom_metrics/custom_metric_set_table.2.golden index 3eb6a25f..bd58b389 100644 --- a/testdata/custom_metrics/custom_metric_set_table.2.golden +++ b/testdata/custom_metrics/custom_metric_set_table.2.golden @@ -1,5 +1,5 @@ ## Benchmark-1 -| Count | ns/op | -|------:|----------:| -| 1500 | 1340ns/op | +| Number of iterations | Nanoseconds per iteration | +|---------------------:|--------------------------:| +| 1500 | 1340 ns/op | diff --git a/testdata/custom_metrics/diff_custom_metric_set_table.0.golden b/testdata/custom_metrics/diff_custom_metric_set_table.0.golden index 9469d3a1..f06e0e32 100644 --- a/testdata/custom_metrics/diff_custom_metric_set_table.0.golden +++ b/testdata/custom_metrics/diff_custom_metric_set_table.0.golden @@ -1,5 +1,5 @@ ## Benchmark-0 -| Count | ns/op | -|------:|---------:| -| 1000 | 676ns/op | +| Number of iterations | Nanoseconds per iteration | +|---------------------:|--------------------------:| +| 1000 | 676.5 ns/op | diff --git a/testdata/custom_metrics/diff_custom_metric_set_table.1.golden b/testdata/custom_metrics/diff_custom_metric_set_table.1.golden index 223acde0..97e7b86d 100644 --- a/testdata/custom_metrics/diff_custom_metric_set_table.1.golden +++ b/testdata/custom_metrics/diff_custom_metric_set_table.1.golden @@ -1,6 +1,6 @@ ## Benchmark-0 -| | ([2345678](https://github.com/owner/repo/commit/2345678901)) | ([1234567](https://github.com/owner/repo/commit/1234567890)) | +/- | -|-----------|--------------------------------------------------------------:|--------------------------------------------------------------:|---------:| -| **Count** | 9393 | 1000 | -8393 | -| **ns/op** | 456ns/op | 676ns/op | 220ns/op | +| | ([2345678](https://github.com/owner/repo/commit/2345678901)) | ([1234567](https://github.com/owner/repo/commit/1234567890)) | +/- | +|-------------------------------|--------------------------------------------------------------:|--------------------------------------------------------------:|------------:| +| **Number of iterations** | 9393 | 1000 | -8393 | +| **Nanoseconds per iteration** | 456.0 ns/op | 676.5 ns/op | 220.5 ns/op |