Last active
February 13, 2020 01:08
-
-
Save NanXiao/82916d8998b4878c21b49d10b13eb6e1 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/usr/bin/awk -f | |
BEGIN { | |
FS = ","; | |
session_id_ticket = 0 | |
} | |
function update_array(len, array) | |
{ | |
if (len != 0) | |
{ | |
session_id_ticket++; | |
if (len <= 128) | |
{ | |
array[128]++; | |
} | |
else if (len <= 256) | |
{ | |
array[256]++; | |
} | |
else | |
{ | |
array[512]++; | |
} | |
} | |
} | |
{ | |
update_array(length($3) / 2, array) | |
update_array(length($4) / 2, array) | |
} | |
END { | |
printf "0 < session_ticket_len <= 128: %d, %.1f%%\n", array[128], array[128] / session_id_ticket * 100; | |
printf "128 < session_ticket_len <= 256: %d, %.1f%%\n", array[256], array[256] / session_id_ticket * 100; | |
printf "256 < session_ticket_len: %d, %.1f%%\n", array[512], array[512] / session_id_ticket * 100; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment