Skip to content

Instantly share code, notes, and snippets.

@alexmoore
Created Sep 25, 2014
Embed
What would you like to do?
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