MCPcopy Create free account
hub / github.com/docker/cli / BenchmarkPrettyPrintInfo

Function BenchmarkPrettyPrintInfo

cli/command/system/info_test.go:418–440  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

416}
417
418func BenchmarkPrettyPrintInfo(b *testing.B) {
419 infoWithSwarm := sampleInfoNoSwarm
420 infoWithSwarm.Swarm = sampleSwarmInfo
421
422 info := dockerInfo{
423 Info: &infoWithSwarm,
424 ClientInfo: &clientInfo{
425 clientVersion: clientVersion{
426 Platform: &platformInfo{Name: "Docker Engine - Community"},
427 Version: "24.0.0",
428 Context: "default",
429 },
430 Debug: true,
431 },
432 }
433 cli := test.NewFakeCli(&fakeClient{})
434
435 b.ReportAllocs()
436 for i := 0; i < b.N; i++ {
437 _ = prettyPrintInfo(cli, info)
438 cli.ResetOutputBuffers()
439 }
440}
441
442func TestFormatInfo(t *testing.T) {
443 for _, tc := range []struct {

Callers

nothing calls this directly

Calls 2

ResetOutputBuffersMethod · 0.95
prettyPrintInfoFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…