Skip to content

Instantly share code, notes, and snippets.

@wuodland

wuodland/l3.awk Secret

Created October 11, 2021 14:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wuodland/6bbb35df2e7b24d987dbaa5b90d07b94 to your computer and use it in GitHub Desktop.
Save wuodland/6bbb35df2e7b24d987dbaa5b90d07b94 to your computer and use it in GitHub Desktop.
BEGIN{
file_name_1 = ARGV[1]
results = "out2.txt"
print file_name_1
hit = 0
miss = 0
satisfied = 0
insatis = 0
indata =0
outdata=0
}
{
#FIFO
if(FILENAME == file_name_1)
{
if($5 == "InInterests")
hit += $8
if($5 == "OutInterests")
miss += $8
if($5 == "SatisfiedInterests")
satisfied += $8
if($5 == "InSatisfiedInterests")
insatis += $8
if($5 == "InData")
indata += $8
if($5 == "OutData")
outdata += $8
}
}
END{
print nocache_hit
printf " Algorithm Interests \n" > results
printf " InInterest %f \n", (hit) > results
printf " OutInterest %f \n", (miss) > results
printf " SatisfiedInterest %f \n", (satisfied) > results
printf " InSatisfiedInterests %f \n", (insatis) > results
printf " InData %f \n", (indata) > results
printf " Outdata %f \n", (outdata) > results
}
@wuodland
Copy link
Author

original script can be found at https://github.com/steps-to-reproduce/ndnSIM-awk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment