Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Paste
P8379
analyze-thread-dumps.sh
Active
Public
Actions
Authored by
•
dduvall
on Apr 9 2019, 9:47 PM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Flag For Later
Tags
None
Referenced Files
F28599519: raw.txt
Apr 9 2019, 9:47 PM
2019-04-09 21:47:33 (UTC+0)
Subscribers
None
#!/bin/sh
tmpdir
=
"
$(
mktemp -d
)
"
if
[[
$#
-lt
1
]]
;
then
echo
"Usage:
$(
basename
"
$0
"
)
dumpfile ..."
exit
1
fi
if
[[
"x
$FT_API_KEY
"
==
"x"
]]
;
then
echo
"Please set the FT_API_KEY environment variable to your fastthread.io API key"
exit
2
fi
mkdir -p
"
$tmpdir
"
/dumps
for
f in
"
$@
"
;
do
(
echo
Full thread dump Java
tail -n +4
"
$f
"
)
>
$tmpdir
/dumps/
"
$(
basename
"
$f
"
)
"
done
cd
"
$tmpdir
"
tar czf dumps.tar.gz dumps/
curl -s -X POST
\
--header
"Content-Type: application/tar"
\
--header
"Content-Encoding: application/gzip"
\
--data-binary @
"
$tmpdir
"
/dumps.tar.gz
\
"https://api.fastthread.io/fastthread-api?apiKey=
$FT_API_KEY
"
rm
"
$tmpdir
"
/dumps/*
rmdir
"
$tmpdir
"
/dumps
rm
"
$tmpdir
"
/dumps.tar.gz
rmdir
"
$tmpdir
"
Event Timeline
•
dduvall
edited the content of this paste.
(Show Details)
Apr 9 2019, 9:47 PM
2019-04-09 21:47:33 (UTC+0)
•
dduvall
changed the title of this paste from untitled to
analyze-thread-dumps.sh
.
•
dduvall
updated the paste's language from
autodetect
to
sh
.
Log In to Comment