mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-10 07:34:04 -08:00
parent
c0ce35d2d3
commit
bf7d87aed2
|
@ -36,6 +36,7 @@ func NewBenchmark(b *testing.B, input string) *Benchmark {
|
||||||
|
|
||||||
// Run runs the benchmark.
|
// Run runs the benchmark.
|
||||||
func (b *Benchmark) Run() {
|
func (b *Benchmark) Run() {
|
||||||
|
defer b.t.Close()
|
||||||
b.b.ReportAllocs()
|
b.b.ReportAllocs()
|
||||||
b.b.ResetTimer()
|
b.b.ResetTimer()
|
||||||
for i := 0; i < b.b.N; i++ {
|
for i := 0; i < b.b.N; i++ {
|
||||||
|
|
|
@ -204,6 +204,8 @@ load 10s
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("unexpected error creating test: %q", err)
|
t.Fatalf("unexpected error creating test: %q", err)
|
||||||
}
|
}
|
||||||
|
defer test.Close()
|
||||||
|
|
||||||
err = test.Run()
|
err = test.Run()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("unexpected error initializing test: %q", err)
|
t.Fatalf("unexpected error initializing test: %q", err)
|
||||||
|
|
Loading…
Reference in a new issue