MCPcopy Create free account
hub / github.com/deepflowio/deepflow / AformatGlobalEntry

Function AformatGlobalEntry

cli/ctl/agent_check.go:336–347  ·  view source on GitHub ↗
(entry *agent.GlobalGPIDEntry)

Source from the content-addressed store, hash-verified

334}
335
336func AformatGlobalEntry(entry *agent.GlobalGPIDEntry) string {
337 buffer := bytes.Buffer{}
338 format := "{ protocol: %d, agent_id_1: %d, epc_id_1: %d, ipv4_1: %s, port_1: %d, pid_1: %d, gpid_1: %d " +
339 "agent_id_0: %d, epc_id_0: %d, ipv4_0: %s, port_0: %d, pid_0: %d, gpid_0: %d, netns_idx: %d}"
340 buffer.WriteString(fmt.Sprintf(format,
341 entry.GetProtocol(),
342 entry.GetAgentId_1(), entry.GetEpcId_1(), utils.IpFromUint32(entry.GetIpv4_1()).String(), entry.GetPort_1(), entry.GetPid_1(), entry.GetGpid_1(),
343 entry.GetAgentId_0(), entry.GetEpcId_0(), utils.IpFromUint32(entry.GetIpv4_0()).String(), entry.GetPort_0(), entry.GetPid_0(), entry.GetGpid_0(),
344 entry.GetNetnsIdx()))
345
346 return buffer.String()
347}
348
349func AgpidGlobalTable(cmd *cobra.Command) {
350 conn := agentGetConn(cmd)

Callers 1

AgpidGlobalTableFunction · 0.85

Calls 2

WriteStringMethod · 0.80
StringMethod · 0.65

Tested by

no test coverage detected