FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
stackstate-process-agent/profile_process_agent.sh at master · StackVista/stackstate-process-agent · GitHub
StackVista
stackstate-process-agent
Repository navigation
Code
Issues
5
(5)
Pull requests
14
(14)
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
stackstate-process-agent
/
profile_process_agent.sh
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
19 lines (13 loc) · 502 Bytes
Breadcrumbs
stackstate-process-agent
/
profile_process_agent.sh
Copy path
File metadata and controls
executable file
·
19 lines (13 loc) · 502 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!
/bin/bash
set
-ex
echo
"
This script is here to profile a deployed process agent instance.
"
POD=
${1
:-
node-agent}
PORT=6062
PODNAME=
$(
kubectl get pods -o=jsonpath=
'
{range .items[*]}{.metadata.name}{"\n"}{end}
'
|
grep
$POD
)
EXEC_REMOTE=
"
kubectl exec
"
$PODNAME
"
-c process-agent --
"
FILE=
$(
mktemp
)
echo
"
Capturing profile from
$PODNAME
for 10 seconds into
$FILE
"
$EXEC_REMOTE
curl localhost:6062/debug/pprof/profile
?
seconds=15
>
"
$FILE
"
echo
"
Profile captured
"
go tool pprof -top
"
$FILE
"
rm
"
$FILE
"
Back
|
FazBrowse Home
|
New Git URL