Created
September 25, 2014 19:05
-
-
Save alexmoore/0d422c4af38ac43ee2f3 to your computer and use it in GitHub Desktop.
Find large Objects
This file contains 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 | |
# For each node, search for reading large object messages, write to largeobject.read file | |
for NODE in 10.58.9*; do | |
IP=`echo "$NODE" | cut -d '-' -f1`; | |
cat $NODE/lo.r.console.log | sed "s/.*Reading large object of size \([0-9]*\) from \(<<.*>>\)\/\(<<.*>>\)/\{\"$IP\",\2,\3,\1\},/" | sort | uniq > $NODE/lo.r.list ; | |
done | |
# For each node, search for writing large object messages, write to largeobject.write file | |
for NODE in 10.58.9*; | |
do IP=`echo "$NODE" | cut -d '-' -f1`; | |
cat $NODE/lo.w.console.log | sed "s/.*Writing very large object (\([0-9]*\) bytes) to \(<<.*>>\)\/\(<<.*>>\)/\{\"$IP\",\2,\3,\1\},/" | uniq | sort > $NODE/lo.w.list; | |
done | |
# Write all largeobject.read and largeobject.write files to one file | |
for NODE in 10.58.9*; do | |
cat $NODE/lo.r.list $NODE/lo.w.list >> lo.list.all; | |
done | |
# Sortify/Uniquify | |
for NODE in 10.58.9*; | |
do echo "[" > $NODE/lo.list; cat $NODE/lo.r.list $NODE/lo.w.list | sort | uniq >> $NODE/lo.list; | |
sed -i .bak '$ s/,$/]/' $NODE/lo.list; | |
done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment