Skip to content

Commit

Permalink
bonsai
Browse files Browse the repository at this point in the history
  • Loading branch information
k1LoW committed Sep 5, 2023
1 parent 0384acb commit 0c99558
Show file tree
Hide file tree
Showing 11 changed files with 69 additions and 69 deletions.
28 changes: 14 additions & 14 deletions report/custom_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
},
}},
}
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand Down
20 changes: 10 additions & 10 deletions report/report_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
},
},
},
Expand All @@ -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"},
},
},
},
Expand All @@ -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"},
},
},
},
Expand Down
12 changes: 6 additions & 6 deletions testdata/custom_metrics/benchmark_0.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
]
}
24 changes: 12 additions & 12 deletions testdata/custom_metrics/benchmark_0_1.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
]
},
Expand All @@ -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"
}
]
}
Expand Down
12 changes: 6 additions & 6 deletions testdata/custom_metrics/benchmark_1.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
]
}
8 changes: 4 additions & 4 deletions testdata/custom_metrics/custom_metric_set_out.1.golden
Original file line number Diff line number Diff line change
@@ -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
8 changes: 4 additions & 4 deletions testdata/custom_metrics/custom_metric_set_out.2.golden
Original file line number Diff line number Diff line change
@@ -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
6 changes: 3 additions & 3 deletions testdata/custom_metrics/custom_metric_set_table.1.golden
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## Benchmark-0

| Count | ns/op |
|------:|---------:|
| 1000 | 676ns/op |
| Number of iterations | Nanoseconds per iteration |
|---------------------:|--------------------------:|
| 1000 | 676.5 ns/op |
6 changes: 3 additions & 3 deletions testdata/custom_metrics/custom_metric_set_table.2.golden
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## Benchmark-1

| Count | ns/op |
|------:|----------:|
| 1500 | 1340ns/op |
| Number of iterations | Nanoseconds per iteration |
|---------------------:|--------------------------:|
| 1500 | 1340 ns/op |
6 changes: 3 additions & 3 deletions testdata/custom_metrics/diff_custom_metric_set_table.0.golden
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## Benchmark-0

| Count | ns/op |
|------:|---------:|
| 1000 | 676ns/op |
| Number of iterations | Nanoseconds per iteration |
|---------------------:|--------------------------:|
| 1000 | 676.5 ns/op |
8 changes: 4 additions & 4 deletions testdata/custom_metrics/diff_custom_metric_set_table.1.golden
Original file line number Diff line number Diff line change
@@ -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 |

0 comments on commit 0c99558

Please sign in to comment.