Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
tsn-measures
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
tsn-measures
Commits
e821008a
Commit
e821008a
authored
Jul 08, 2020
by
Joanne Hugé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update measure-analysis script
Allow user to import metadata from a file instead
parent
85bef512
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
3 deletions
+18
-3
measure-analysis/measure-analysis.py
measure-analysis/measure-analysis.py
+18
-3
No files found.
measure-analysis/measure-analysis.py
View file @
e821008a
...
...
@@ -63,7 +63,7 @@ class MeasureSetHandler:
with
open
(
MeasureSetHandler
.
measure_sets_path
,
'w'
)
as
measure_sets_file
:
json
.
dump
(
self
.
measure_sets
,
measure_sets_file
)
def
import_from_json
(
self
,
path
,
flat
=
False
,
cyclictest
=
False
,
user_input
=
False
):
def
import_from_json
(
self
,
path
,
flat
=
False
,
cyclictest
=
False
,
user_input
=
False
,
file_input
=
None
):
measure_sets
=
[]
...
...
@@ -74,11 +74,18 @@ class MeasureSetHandler:
else
:
data
=
json
.
load
(
infile
)
if
file_input
!=
None
:
with
open
(
file_input
)
as
metadata_file
:
metadata
=
json
.
load
(
metadata_file
)
for
measure_set_data
in
data
[
'measure_sets'
]:
measure_set
=
MeasureSet
()
measure_set
.
import_from_json_data
(
measure_set_data
,
flat
=
flat
,
user_input
=
user_input
)
if
file_input
!=
None
:
measure_set
.
update_metadata
(
metadata
,
[]);
measure_sets
.
append
(
measure_set
)
return
measure_sets
...
...
@@ -677,6 +684,7 @@ def parse_args():
parser
=
argparse
.
ArgumentParser
(
description
=
'Measure analysis'
)
parser
.
add_argument
(
'-i'
,
nargs
=
1
,
required
=
False
,
help
=
'import file'
)
parser
.
add_argument
(
'-c'
,
action
=
'store_true'
,
required
=
False
,
help
=
'parse cyclictest histogram'
)
parser
.
add_argument
(
'-I'
,
nargs
=
1
,
required
=
False
,
help
=
'import metadata file'
)
parser
.
add_argument
(
'--remove'
,
nargs
=
1
,
required
=
False
,
help
=
'remove a measure'
)
parser
.
add_argument
(
'--remove-type'
,
nargs
=
1
,
required
=
False
,
help
=
'remove all measures from a type'
)
parser
.
add_argument
(
'--remove-all'
,
action
=
'store_true'
,
help
=
'remove all measure sets'
)
...
...
@@ -712,10 +720,17 @@ def parse_args():
if
args
.
i
is
not
None
:
if
args
.
I
is
not
None
:
file_input
=
args
.
I
[
0
]
user_input
=
False
else
:
file_input
=
None
user_input
=
True
if
args
.
c
:
measure_sets
=
ms_handler
.
import_from_json
(
args
.
i
[
0
],
cyclictest
=
True
,
user_input
=
True
)
measure_sets
=
ms_handler
.
import_from_json
(
args
.
i
[
0
],
cyclictest
=
True
,
user_input
=
user_input
,
file_input
=
file_input
)
else
:
measure_sets
=
ms_handler
.
import_from_json
(
args
.
i
[
0
],
flat
=
True
,
user_input
=
True
)
measure_sets
=
ms_handler
.
import_from_json
(
args
.
i
[
0
],
flat
=
True
,
user_input
=
user_input
,
file_input
=
file_input
)
for
measure_set
in
measure_sets
:
ms_handler
.
add_measure_set
(
measure_set
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment