-
-
Save dsc/4611085 to your computer and use it in GitHub Desktop.
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 host in cp104{1,2,3,4}; do | |
first_seq=$(head -n 1 $host.udp2log.seq | awk '{print $1}') # && echo $first_seq | |
last_seq=$(tail -n 1 $host.hdfs.seq | awk '{print $1}') # && echo $last_seq | |
should_be=$(echo "$last_seq - $first_seq + 1" | bc) #&& echo $should_be | |
# count lines in blog.hdfs.seq file between $first_seq and $last_seq | |
hdfs_count=$(sed -n -e "/^$first_seq/,/^$last_seq/p" $host.udp2log.seq | wc -l) #&& echo $hdfs_count | |
udp2log_count=$(sed -n -e "/^$first_seq/,/^$last_seq/p" $host.udp2log.seq | wc -l) #&& echo $udp2log_count | |
echo "----" | |
echo "$host:" | |
echo " should_be: $should_be"; echo " udp2log_count: $udp2log_count"; echo " hdfs_count: $hdfs_count"; | |
done | |
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
cp1041: | |
should_be: 2996340 | |
udp2log_count: 2558004 | |
hdfs_count: 2558004 | |
cp1042: | |
should_be: 2992324 | |
udp2log_count: 2554088 | |
hdfs_count: 2554088 | |
cp1043: | |
should_be: 3004241 | |
udp2log_count: 2565111 | |
hdfs_count: 2565111 | |
cp1044: | |
should_be: 3005422 | |
udp2log_count: 2566392 | |
hdfs_count: 2566392 |
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
cp1044: | |
total: 3005422 | |
udp2log: 2,566,392 (-14.608%, -439,030) | |
hdfs: 2,566,392 (-14.608%, -439,030) | |
cp1041: | |
total: 2996340 | |
udp2log: 2,558,004 (-14.629%, -438,336) | |
hdfs: 2,558,004 (-14.629%, -438,336) | |
cp1042: | |
total: 2992324 | |
udp2log: 2,554,088 (-14.645%, -438,236) | |
hdfs: 2,554,088 (-14.645%, -438,236) | |
cp1043: | |
total: 3004241 | |
udp2log: 2,565,111 (-14.617%, -439,130) | |
hdfs: 2,565,111 (-14.617%, -439,130) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment