pkg/fileutils: add BenchmarkGetTotalUsedFds
go test -bench ^BenchmarkGetTotalUsedFds$ -run ^$ ./pkg/fileutils/
goos: linux
goarch: arm64
pkg: github.com/docker/docker/pkg/fileutils
BenchmarkGetTotalUsedFds-5 149272 7896 ns/op 945 B/op 20 allocs/op
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 03390be5fa
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
01eb4835c9
commit
5dcea89ce1
1 changed files with 7 additions and 0 deletions
|
@ -240,3 +240,10 @@ func TestCreateIfNotExistsFile(t *testing.T) {
|
|||
t.Errorf("Should have been a file, seems it's not")
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkGetTotalUsedFds(b *testing.B) {
|
||||
b.ReportAllocs()
|
||||
for i := 0; i < b.N; i++ {
|
||||
_ = GetTotalUsedFds()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue