Skip to content

Instantly share code, notes, and snippets.

@alexmoore
Created September 25, 2014 19:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexmoore/0d422c4af38ac43ee2f3 to your computer and use it in GitHub Desktop.
Save alexmoore/0d422c4af38ac43ee2f3 to your computer and use it in GitHub Desktop.
Find large Objects
#!/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