source: trunk/bin/analyze_packets @ 22

Last change on this file since 22 was 16, checked in by tim, 9 years ago

.

  • Property svn:executable set to *
File size: 955 bytes
RevLine 
[4]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
12
[16]13
[4]14VERSION = "{DEVELOPMENT}"
15if 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
26from nanownlib import *
27import nanownlib.storage
28
29
30parser = argparse.ArgumentParser(
31    description="")
32parser.add_argument('db_file', default=None,
33                    help='')
34options = parser.parse_args()
35
36
37db = nanownlib.storage.db(options.db_file)
38
39start = time.time()
[10]40import cProfile
41#cProfile.run('num_probes = analyzeProbes(db)')
[16]42num_probes = analyzeProbes(db, recompute=True)
[4]43end = time.time()
44print("analyzed %d probes' packets in: %f" % (num_probes, end-start))
Note: See TracBrowser for help on using the repository browser.