Created
May 15, 2017 04:44
-
-
Save jasonkeene/c8cad152a727b629b9596a9863446cca to your computer and use it in GitHub Desktop.
Query a metron process for the read/write head delta.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
b github.com/cloudfoundry/diodes.(*OneToOne).TryNext | |
c | |
p d.readIndex | |
p d.writeIndex | |
q | |
n |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ "$1" = "" ]; then | |
echo i need how many iterations | |
exit 1 | |
fi | |
pid=$(ps aux | grep metron | grep -E '.json$' | awk '{print $2}') | |
if [ "$(echo "$pid" | wc -l)" != "1" ]; then | |
echo bad pid | |
exit 1 | |
fi | |
for i in $(seq "$1"); do | |
echo attempting dump "$i" | |
cat ./diode_heads.dlv | | |
./dlv attach "$pid" /var/vcap/packages/metron_agent/metron | | |
tail -n 3 | | |
head -n 2 | | |
awk '{print $2}' | | |
python -c 'import sys; r = int(sys.stdin.readline().strip()); w = int(sys.stdin.readline().strip()); print w-r' | |
sleep 1 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment