File tree 1 file changed +32
-0
lines changed 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change
1
+ # -*- coding: utf-8 -*-
2
+
3
+ import pyperf
4
+
5
+ from pcapkit import extract
6
+
7
+
8
+ def default () -> 'None' :
9
+ extract (fin = '../sample/in.pcap' , fout = '../sample/engines/default.txt' ,
10
+ format = 'tree' , engine = 'default' )
11
+
12
+
13
+ def scapy () -> 'None' :
14
+ extract (fin = '../sample/in.pcap' , fout = '../sample/engines/scapy.txt' ,
15
+ format = 'tree' , engine = 'scapy' )
16
+
17
+
18
+ def dpkt () -> 'None' :
19
+ extract (fin = '../sample/in.pcap' , fout = '../sample/engines/dpkt.txt' ,
20
+ format = 'tree' , engine = 'dpkt' )
21
+
22
+
23
+ def pyshark () -> 'None' :
24
+ extract (fin = '../sample/in.pcap' , fout = '../sample/engines/pyshark.txt' ,
25
+ format = 'tree' , engine = 'pyshark' )
26
+
27
+
28
+ runner = pyperf .Runner ()
29
+ runner .bench_func ('default' , default )
30
+ runner .bench_func ('scapy' , scapy )
31
+ runner .bench_func ('dpkt' , dpkt )
32
+ runner .bench_func ('pyshark' , pyshark )
You can’t perform that action at this time.
0 commit comments