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

Function AformatEntries

cli/ctl/agent_check.go:371–382  ·  view source on GitHub ↗
(entry *agent.GPIDSyncEntry)

Source from the content-addressed store, hash-verified

369}
370
371func AformatEntries(entry *agent.GPIDSyncEntry) string {
372 buffer := bytes.Buffer{}
373 format := "{protocol: %d, epc_id_1: %d, ipv4_1: %s, port_1: %d, pid_1: %d, " +
374 "epc_id_0: %d, ipv4_0: %s, port_0: %d, pid_0: %d, epc_id_real: %d, " +
375 "ipv4_real: %s, port_real: %d, pid_real: %d, role_real: %d, netns_idx: %d}"
376 buffer.WriteString(fmt.Sprintf(format,
377 entry.GetProtocol(), entry.GetEpcId_1(), utils.IpFromUint32(entry.GetIpv4_1()).String(), entry.GetPort_1(), entry.GetPid_1(),
378 entry.GetEpcId_0(), utils.IpFromUint32(entry.GetIpv4_0()).String(), entry.GetPort_0(), entry.GetPid_0(), entry.GetEpcIdReal(),
379 utils.IpFromUint32(entry.GetIpv4Real()).String(), entry.GetPortReal(), entry.GetPidReal(), entry.GetRoleReal(), entry.GetNetnsIdx()),
380 )
381 return buffer.String()
382}
383
384func getAgentConn(cmd *cobra.Command) *grpc.ClientConn {
385 server := common.GetServerInfo(cmd)

Callers 2

AgpidAgentResponseFunction · 0.85
AgpidAgentRequestFunction · 0.85

Calls 2

WriteStringMethod · 0.80
StringMethod · 0.65

Tested by

no test coverage detected