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

Function tableProcess

cli/ctl/genesis.go:354–373  ·  view source on GitHub ↗
(response *simplejson.Json, table *tablewriter.Table)

Source from the content-addressed store, hash-verified

352}
353
354func tableProcess(response *simplejson.Json, table *tablewriter.Table) {
355 table.SetHeader([]string{"PID", "AGENT_ID", "NETNS_ID", "NAME", "PROCESS_NAME", "USER", "START_TIME"})
356
357 tableItems := [][]string{}
358 for i := range response.Get("DATA").MustArray() {
359 data := response.Get("DATA").GetIndex(i)
360 tableItem := []string{}
361 tableItem = append(tableItem, strconv.Itoa(data.Get("PID").MustInt()))
362 tableItem = append(tableItem, strconv.Itoa(data.Get("VTAP_ID").MustInt()))
363 tableItem = append(tableItem, strconv.Itoa(data.Get("NETNS_ID").MustInt()))
364 tableItem = append(tableItem, data.Get("NAME").MustString())
365 tableItem = append(tableItem, data.Get("PROCESS_NAME").MustString())
366 tableItem = append(tableItem, data.Get("USER").MustString())
367 tableItem = append(tableItem, data.Get("START_TIME").MustString())
368 tableItems = append(tableItems, tableItem)
369 }
370
371 table.AppendBulk(tableItems)
372 table.Render()
373}
374
375func agentInfo(cmd *cobra.Command, args []string) {
376 if len(args) == 0 {

Callers 1

syncInfoFunction · 0.85

Calls 4

SetHeaderMethod · 0.80
AppendBulkMethod · 0.80
RenderMethod · 0.80
GetMethod · 0.65

Tested by

no test coverage detected