[tor-commits] [onionperf/master] Bump analysis version to 4.0

karsten at torproject.org karsten at torproject.org
Fri Sep 18 08:29:49 UTC 2020


commit d0660c1847b46863783b7006efdac4df8103f123
Author: Ana Custura <ana at netstat.org.uk>
Date:   Thu Sep 10 12:54:41 2020 +0100

    Bump analysis version to 4.0
---
 onionperf/analysis.py  | 4 ++--
 onionperf/filtering.py | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/onionperf/analysis.py b/onionperf/analysis.py
index 49c109c..907d451 100644
--- a/onionperf/analysis.py
+++ b/onionperf/analysis.py
@@ -24,7 +24,7 @@ class OPAnalysis(Analysis):
 
     def __init__(self, nickname=None, ip_address=None):
         super().__init__(nickname, ip_address)
-        self.json_db = {'type': 'onionperf', 'version': '3.0', 'data': {}}
+        self.json_db = {'type': 'onionperf', 'version': '4.0', 'data': {}}
         self.torctl_filepaths = []
 
     def add_torctl_file(self, filepath):
@@ -133,7 +133,7 @@ class OPAnalysis(Analysis):
         if 'type' not in db or 'version' not in db:
             logging.warning("'type' or 'version' not present in database")
             return None
-        elif db['type'] != 'onionperf' or str(db['version']) >= '4.':
+        elif db['type'] != 'onionperf' or str(db['version']) >= '5.':
             logging.warning("type or version not supported (type={0}, version={1})".format(db['type'], db['version']))
             return None
         else:
diff --git a/onionperf/filtering.py b/onionperf/filtering.py
index 0ba9ebc..e8ea164 100644
--- a/onionperf/filtering.py
+++ b/onionperf/filtering.py
@@ -71,6 +71,7 @@ class Filtering(object):
         self.analysis = OPAnalysis.load(filename=input_path)
         self.filter_tor_circuits(self.analysis)
         self.analysis.json_db["filters"] = self.filters
+        self.analysis.json_db["version"] = '4.0'
         self.analysis.json_db = dict(sorted(self.analysis.json_db.items()))
         self.analysis.save(filename=output_file, output_prefix=output_dir, sort_keys=False)
 





More information about the tor-commits mailing list