Created
June 24, 2013 09:00
-
-
Save juven/5848707 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
BEGIN { | |
FS = "," | |
bytes_created = 0 | |
bytes_wrote = 0 | |
bytes_deleted = 0 | |
} | |
$4 == "createFile" { | |
bytes_field_length = length($10) | |
bytes_created += substr($10, 3, bytes_field_length-3) | |
printf("create %s\n", substr($10, 3, bytes_field_length-3)) | |
} | |
$4 == "delete" { | |
bytes_field_length = length($7) | |
bytes_deleted += substr($7, 3, bytes_field_length-3) | |
printf("delete %s\n", substr($7, 3, bytes_field_length-3)) | |
} | |
$4 == "writeFile" { | |
bytes_field_length = length($9) | |
bytes_wrote += substr($9, 3, bytes_field_length-3) | |
printf("write %s\n", substr($9, 3, bytes_field_length-3)) | |
} | |
END { | |
printf("Total (create + write - delete): %s \n" , bytes_created + bytes_wrote - bytes_deleted) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment