|
16 | 16 |
|
17 | 17 | import px |
18 | 18 |
|
19 | | -df = px.GetAgentStatus() |
20 | | -df.ip_address = px.pluck_array(px.split(df.ip_address, ":"), 0) |
21 | | -df.hostname_by_ip = px.pod_id_to_node_name(px.ip_to_pod_id(df.ip_address)) |
22 | | -df.hostname = px.select(df.hostname_by_ip == "", df.hostname, df.hostname_by_ip) |
23 | | -df = df[['asid', 'hostname']] |
24 | | -heap_stats = px._HeapGrowthStacks() |
25 | | -df = df.merge(heap_stats, how='inner', left_on='asid', right_on='asid') |
26 | | -df.asid = df.asid_x |
27 | | -df = df[['asid', 'hostname', 'heap']] |
28 | | -px.display(df) |
| 19 | + |
| 20 | +# TODO(ddelnano): asid is unused until gh#2245 is addressed. |
| 21 | +def collect_pprofs(asid: int): |
| 22 | + df = px.GetAgentStatus() |
| 23 | + df.ip_address = px.pluck_array(px.split(df.ip_address, ":"), 0) |
| 24 | + df.hostname_by_ip = px.pod_id_to_node_name(px.ip_to_pod_id(df.ip_address)) |
| 25 | + df.hostname = px.select(df.hostname_by_ip == "", df.hostname, df.hostname_by_ip) |
| 26 | + df = df[['asid', 'hostname']] |
| 27 | + heap_stats = px._HeapGrowthStacks() |
| 28 | + df = df.merge(heap_stats, how='inner', left_on='asid', right_on='asid') |
| 29 | + df.asid = df.asid_x |
| 30 | + return df[['asid', 'hostname', 'heap']] |
0 commit comments