Last change
on this file since 23 was
16,
checked in by tim, 9 years ago
|
.
|
-
Property svn:executable set to
*
|
File size:
955 bytes
|
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 | |
---|
[16] | 13 | |
---|
[4] | 14 | VERSION = "{DEVELOPMENT}" |
---|
| 15 | if VERSION == "{DEVELOPMENT}": |
---|
| 16 | script_dir = '.' |
---|
| 17 | try: |
---|
| 18 | script_dir = os.path.dirname(os.path.realpath(__file__)) |
---|
| 19 | except: |
---|
| 20 | try: |
---|
| 21 | script_dir = os.path.dirname(os.path.abspath(sys.argv[0])) |
---|
| 22 | except: |
---|
| 23 | pass |
---|
| 24 | sys.path.append("%s/../lib" % script_dir) |
---|
| 25 | |
---|
| 26 | from nanownlib import * |
---|
| 27 | import nanownlib.storage |
---|
| 28 | |
---|
| 29 | |
---|
| 30 | parser = argparse.ArgumentParser( |
---|
| 31 | description="") |
---|
| 32 | parser.add_argument('db_file', default=None, |
---|
| 33 | help='') |
---|
| 34 | options = parser.parse_args() |
---|
| 35 | |
---|
| 36 | |
---|
| 37 | db = nanownlib.storage.db(options.db_file) |
---|
| 38 | |
---|
| 39 | start = time.time() |
---|
[10] | 40 | import cProfile |
---|
| 41 | #cProfile.run('num_probes = analyzeProbes(db)') |
---|
[16] | 42 | num_probes = analyzeProbes(db, recompute=True) |
---|
[4] | 43 | end = time.time() |
---|
| 44 | print("analyzed %d probes' packets in: %f" % (num_probes, end-start)) |
---|
Note: See
TracBrowser
for help on using the repository browser.