Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
Onionperf
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Karsten Loesing
Onionperf
Commits
d3dfb5b2
Commit
d3dfb5b2
authored
May 14, 2020
by
Karsten Loesing
Browse files
Options
Downloads
Patches
Plain Diff
Update analysis results file version to 2.0.
Implements #34224.
parent
fd942042
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
README_JSON.md
+3
-1
3 additions, 1 deletion
README_JSON.md
onionperf/analysis.py
+4
-4
4 additions, 4 deletions
onionperf/analysis.py
with
7 additions
and
5 deletions
README_JSON.md
+
3
−
1
View file @
d3dfb5b2
...
...
@@ -207,5 +207,7 @@ The structure is given here with variable keys marked as such.
}
}
}
}
},
"type": "onionperf", # document type
"version": "2.0" # document version
}
This diff is collapsed.
Click to expand it.
onionperf/analysis.py
+
4
−
4
View file @
d3dfb5b2
...
...
@@ -37,7 +37,7 @@ class Analysis(object):
self
.
nickname
=
nickname
self
.
measurement_ip
=
ip_address
self
.
hostname
=
gethostname
().
split
(
'
.
'
)[
0
]
self
.
json_db
=
{
'
type
'
:
'
onionperf
'
,
'
version
'
:
1
.0
,
'
data
'
:{}}
self
.
json_db
=
{
'
type
'
:
'
onionperf
'
,
'
version
'
:
'
2
.0
'
,
'
data
'
:{}}
self
.
tgen_filepaths
=
[]
self
.
torctl_filepaths
=
[]
self
.
date_filter
=
None
...
...
@@ -102,7 +102,7 @@ class Analysis(object):
else
:
self
.
json_db
[
'
data
'
][
nickname
]
=
analysis
.
json_db
[
'
data
'
][
nickname
]
def
save
(
self
,
filename
=
None
,
output_prefix
=
os
.
getcwd
(),
do_compress
=
True
,
version
=
1.0
):
def
save
(
self
,
filename
=
None
,
output_prefix
=
os
.
getcwd
(),
do_compress
=
True
):
if
filename
is
None
:
if
self
.
date_filter
is
None
:
filename
=
"
onionperf.analysis.json.xz
"
...
...
@@ -122,7 +122,7 @@ class Analysis(object):
logging
.
info
(
"
done!
"
)
@classmethod
def
load
(
cls
,
filename
=
"
onionperf.analysis.json.xz
"
,
input_prefix
=
os
.
getcwd
()
,
version
=
1.0
):
def
load
(
cls
,
filename
=
"
onionperf.analysis.json.xz
"
,
input_prefix
=
os
.
getcwd
()):
filepath
=
os
.
path
.
abspath
(
os
.
path
.
expanduser
(
"
{0}
"
.
format
(
filename
)))
if
not
os
.
path
.
exists
(
filepath
):
filepath
=
os
.
path
.
abspath
(
os
.
path
.
expanduser
(
"
{0}/{1}
"
.
format
(
input_prefix
,
filename
)))
...
...
@@ -142,7 +142,7 @@ class Analysis(object):
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
db
[
'
version
'
]
!=
1.0
:
elif
db
[
'
type
'
]
!=
'
onionperf
'
or
str
(
db
[
'
version
'
]
)
>=
'
3.
'
:
logging
.
warning
(
"
type or version not supported (type={0}, version={1})
"
.
format
(
db
[
'
type
'
],
db
[
'
version
'
]))
return
None
else
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment