Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@

import px

df = px.GetAgentStatus()
df.ip_address = px.pluck_array(px.split(df.ip_address, ":"), 0)
df.hostname_by_ip = px.pod_id_to_node_name(px.ip_to_pod_id(df.ip_address))
df.hostname = px.select(df.hostname_by_ip == "", df.hostname, df.hostname_by_ip)
df = df[['asid', 'hostname']]
heap_stats = px._HeapGrowthStacks()
df = df.merge(heap_stats, how='inner', left_on='asid', right_on='asid')
df.asid = df.asid_x
df = df[['asid', 'hostname', 'heap']]
px.display(df)

# TODO(ddelnano): asid is unused until gh#2245 is addressed.
def collect_pprofs(asid: int):
df = px.GetAgentStatus()
df.ip_address = px.pluck_array(px.split(df.ip_address, ":"), 0)
df.hostname_by_ip = px.pod_id_to_node_name(px.ip_to_pod_id(df.ip_address))
df.hostname = px.select(df.hostname_by_ip == "", df.hostname, df.hostname_by_ip)
df = df[['asid', 'hostname']]
heap_stats = px._HeapGrowthStacks()
df = df.merge(heap_stats, how='inner', left_on='asid', right_on='asid')
df.asid = df.asid_x
return df[['asid', 'hostname', 'heap']]
3 changes: 3 additions & 0 deletions src/pxl_scripts/px/collect_agent_heaps/manifest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
short: Collect Agent Heap Dumps
long: Script useful for debugging kelvin and PEM memory footprint.
39 changes: 39 additions & 0 deletions src/pxl_scripts/px/collect_agent_heaps/vis.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"variables": [
{
"name": "asid",
"type": "PX_INT64",
"description": "Whether to filter the results to a particular ASID",
"defaultValue": "-1"
}
],
"globalFuncs": [
{
"outputName": "collect_pprofs",
"func": {
"name": "collect_pprofs",
"args": [
{
"name": "asid",
"variable": "asid"
}
]
}
}
],
"widgets": [
{
"name": "Table",
"position": {
"x": 0,
"y": 0,
"w": 12,
"h": 4
},
"globalFuncOutputName": "collect_pprofs",
"displaySpec": {
"@type": "types.px.dev/px.vispb.Table"
}
}
]
}