Last change
on this file since 11 was
10,
checked in by tim, 9 years ago
|
.
|
-
Property svn:executable set to
*
|
File size:
1.1 KB
|
Rev | Line | |
---|
[4] | 1 | #!/usr/bin/env python3 |
---|
| 2 | #-*- mode: Python;-*- |
---|
| 3 | |
---|
| 4 | import sys |
---|
| 5 | import os |
---|
| 6 | import time |
---|
| 7 | import random |
---|
| 8 | import tempfile |
---|
| 9 | import argparse |
---|
| 10 | import socket |
---|
| 11 | import json |
---|
| 12 | try: |
---|
| 13 | import requests |
---|
| 14 | except: |
---|
| 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 | |
---|
| 19 | VERSION = "{DEVELOPMENT}" |
---|
| 20 | if 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 | |
---|
| 31 | from nanownlib import * |
---|
| 32 | import nanownlib.storage |
---|
| 33 | |
---|
| 34 | |
---|
| 35 | parser = argparse.ArgumentParser( |
---|
| 36 | description="") |
---|
| 37 | parser.add_argument('db_file', default=None, |
---|
| 38 | help='') |
---|
| 39 | options = parser.parse_args() |
---|
| 40 | |
---|
| 41 | |
---|
| 42 | |
---|
| 43 | db = nanownlib.storage.db(options.db_file) |
---|
| 44 | |
---|
| 45 | start = time.time() |
---|
[10] | 46 | import cProfile |
---|
| 47 | #cProfile.run('num_probes = analyzeProbes(db)') |
---|
[4] | 48 | num_probes = analyzeProbes(db) |
---|
| 49 | end = time.time() |
---|
| 50 | print("analyzed %d probes' packets in: %f" % (num_probes, end-start)) |
---|
Note: See
TracBrowser
for help on using the repository browser.