MCPcopy Create free account
hub / github.com/IceFireDB/IceFireDB / Dump

Method Dump

server_info.go:63–97  ·  view source on GitHub ↗
(section string)

Source from the content-addressed store, hash-verified

61}
62
63func (i *info) Dump(section string) []byte {
64 buf := &bytes.Buffer{}
65 switch strings.ToLower(section) {
66 case "":
67 i.dumpAll(buf)
68 case "server":
69 i.dumpServer(buf)
70 case "mem":
71 i.dumpMem(buf)
72 case "gc":
73 i.dumpGC(buf)
74 case "store":
75 i.dumpStore(buf)
76 default:
77 buf.WriteString(fmt.Sprintf("# %s\r\n", section))
78 }
79 // add extension info data
80 for _, ifn := range i.ExtInfo {
81 tit, metrics := ifn()
82 buf.WriteString(fmt.Sprintf("# %s\r\n", tit))
83 pairs := make([]infoPair, len(metrics))
84 j := 0
85 for _, v := range metrics {
86 for key, val := range v {
87 pairs[j] = infoPair{
88 Key: key,
89 Value: val,
90 }
91 j++
92 }
93 }
94 i.dumpPairs(buf, pairs...)
95 }
96 return buf.Bytes()
97}
98
99type infoPair struct {
100 Key string

Callers 5

cmdINFOFunction · 0.45
DataMethod · 0.45
DataMethod · 0.45
DataMethod · 0.45
DataMethod · 0.45

Calls 7

dumpAllMethod · 0.95
dumpServerMethod · 0.95
dumpMemMethod · 0.95
dumpGCMethod · 0.95
dumpStoreMethod · 0.95
dumpPairsMethod · 0.95
BytesMethod · 0.45

Tested by

no test coverage detected