MCPcopy
hub / github.com/google/cadvisor / BenchmarkProcessLimitsFile

Function BenchmarkProcessLimitsFile

lib/container/libcontainer/handler_test.go:369–380  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

367var ulimits []info.UlimitSpec
368
369func BenchmarkProcessLimitsFile(b *testing.B) {
370 content, err := os.ReadFile("testdata/limits")
371 assert.Nil(b, err)
372
373 b.ResetTimer()
374 for i := 0; i < b.N; i++ {
375 ulimits = processLimitsFile(string(content))
376 }
377
378 // Ensure the compiler doesn't optimize away the benchmark
379 _ = ulimits
380}
381
382func TestProcessMaxOpenFileLimitLine(t *testing.T) {
383 line := " 1073741816 1073741816 files "

Callers

nothing calls this directly

Calls 2

processLimitsFileFunction · 0.85
ReadFileMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…