File: log_test.go

package info (click to toggle)
restic 0.9.4%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 26,636 kB
  • sloc: sh: 1,460; makefile: 46; python: 35
file content (34 lines) | stat: -rw-r--r-- 526 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package debug_test

import (
	"github.com/restic/restic/internal/debug"
	"github.com/restic/restic/internal/restic"

	"testing"
)

func BenchmarkLogStatic(b *testing.B) {
	for i := 0; i < b.N; i++ {
		debug.Log("Static string")
	}
}

func BenchmarkLogIDStr(b *testing.B) {
	id := restic.NewRandomID()

	b.ResetTimer()

	for i := 0; i < b.N; i++ {
		debug.Log("id: %v", id)
	}
}

func BenchmarkLogIDString(b *testing.B) {
	id := restic.NewRandomID()

	b.ResetTimer()

	for i := 0; i < b.N; i++ {
		debug.Log("id: %s", id)
	}
}