File size: 612 Bytes
8dc315b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
""" 
this script performs simple analysis of the stat generated in cleaning 

"""


import os, sys
import time
import csv
import pickle, json
from collections import defaultdict, Counter
import struct 


def analysis1(datafile):
    with open("{}_stat.json".format(datafile), "r") as ifile:
        content_cnt, extension_cnt, hostname_cnt, method_cnt, n_level_cnt, n_param_cnt = json.load(ifile)

    n = 0
    for k, v in sorted(hostname_cnt.items(), key=lambda x: -x[1]):
        n += 1
        print(k, v//1e6)
        if n > 2000:
            break 


if __name__ == "__main__":
    analysis1(sys.argv[1])