source: trunk/bin/analyze_packets @ 8

Last change on this file since 8 was 5, checked in by tim, 9 years ago

.

  • Property svn:executable set to *
File size: 1.1 KB
Line 
1#!/usr/bin/env python3
2#-*- mode: Python;-*-
3
4import sys
5import os
6import time
7import random
8import tempfile
9import argparse
10import socket
11import json
12try:
13    import requests
14except:
15    sys.stderr.write('ERROR: Could not import requests module.  Ensure it is installed.\n')
16    sys.stderr.write('       Under Debian, the package name is "python3-requests"\n.')
17    sys.exit(1)
18
19VERSION = "{DEVELOPMENT}"
20if VERSION == "{DEVELOPMENT}":
21    script_dir = '.'
22    try:
23        script_dir = os.path.dirname(os.path.realpath(__file__))
24    except:
25        try:
26            script_dir = os.path.dirname(os.path.abspath(sys.argv[0]))
27        except:
28            pass
29    sys.path.append("%s/../lib" % script_dir)
30
31from nanownlib import *
32import nanownlib.storage
33
34
35parser = argparse.ArgumentParser(
36    description="")
37parser.add_argument('db_file', default=None,
38                    help='')
39options = parser.parse_args()
40
41
42
43db = nanownlib.storage.db(options.db_file)
44
45start = time.time()
46num_probes = analyzeProbes(db)
47end = time.time()
48print("analyzed %d probes' packets in: %f" % (num_probes, end-start))
Note: See TracBrowser for help on using the repository browser.