Created
December 12, 2013 03:45
-
-
Save manuzhang/7922886 to your computer and use it in GitHub Desktop.
extract data from log using awk and tr
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/sh - | |
JOB_DIR=$1 | |
NUM=$2 | |
UNCOMP=0 | |
for TASK in `ls $JOB_DIR | grep 'attempt.*_m_.*'` | |
do | |
ucp=`awk '/.*[\[]MapOutputCollector::mid_spill[\]].*/ { print $28 }' $JOB_DIR/$TASK/stderr | tr -cd [:digit:]` | |
let "UNCOMP += ucp" | |
done | |
let " OUTPUT = $UNCOMP / $NUM / (1024 * 1024) " | |
echo $OUTPUT MB |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment