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
1383ec9e
Commit
1383ec9e
authored
Jun 02, 2020
by
Joanne Hugé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Optimize histogram measures add
parent
dfd7f72d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
6 deletions
+21
-6
measure-analysis/measure-analysis.py
measure-analysis/measure-analysis.py
+21
-6
No files found.
measure-analysis/measure-analysis.py
View file @
1383ec9e
...
@@ -73,7 +73,7 @@ class MeasureSetHandler:
...
@@ -73,7 +73,7 @@ class MeasureSetHandler:
mid
=
self
.
measure_sets
[
mtype
][
'ids'
][
0
]
mid
=
self
.
measure_sets
[
mtype
][
'ids'
][
0
]
print
(
" Deleting {}{}..."
.
format
(
mtype
,
mid
))
print
(
" Deleting {}{}..."
.
format
(
mtype
,
mid
))
self
.
remove_measure_set
(
mtype
,
mid
)
self
.
remove_measure_set
(
mtype
,
mid
)
print
(
"Removed all measures"
.
format
(
mtype
,
mid
)
)
print
(
"Removed all measures"
)
def
generate_graphs
(
self
):
def
generate_graphs
(
self
):
...
@@ -206,6 +206,7 @@ class MeasureSet:
...
@@ -206,6 +206,7 @@ class MeasureSet:
'board'
:
'Board name'
,
'board'
:
'Board name'
,
'boot_p'
:
'Boot Parameters'
,
'boot_p'
:
'Boot Parameters'
,
'delta'
:
'ETF qdisc delta'
,
'delta'
:
'ETF qdisc delta'
,
'load'
:
'Device and processor load'
,
}
}
def
__init__
(
self
):
def
__init__
(
self
):
...
@@ -217,6 +218,8 @@ class MeasureSet:
...
@@ -217,6 +218,8 @@ class MeasureSet:
self
.
metadata
[
'i'
]
=
"200us"
self
.
metadata
[
'i'
]
=
"200us"
self
.
metadata
[
'delta'
]
=
"200us"
self
.
metadata
[
'delta'
]
=
"200us"
self
.
metadata
[
'prio'
]
=
"200us"
self
.
metadata
[
'prio'
]
=
"200us"
self
.
metadata
[
'load'
]
=
"ssh"
self
.
metadata
[
'duration'
]
=
"24h"
self
.
props
=
[]
self
.
props
=
[]
self
.
props_name
=
[]
self
.
props_name
=
[]
...
@@ -286,12 +289,24 @@ class MeasureSet:
...
@@ -286,12 +289,24 @@ class MeasureSet:
self
.
var
=
[]
self
.
var
=
[]
for
prop
in
props
:
for
prop
in
props
:
chrono
=
MeasureSet
.
histogram_to_chronological
(
prop
)
self
.
max
.
append
(
max
(
chrono
))
self
.
min
.
append
(
min
(
chrono
))
self
.
avg
.
append
(
statistics
.
mean
(
chrono
))
self
.
var
.
append
(
statistics
.
variance
(
chrono
))
enumerate_prop
=
list
(
enumerate
(
prop
))
self
.
max
.
append
(
max
(
list
(
map
(
lambda
x
:
x
[
0
]
if
x
[
1
]
else
0
,
enumerate_prop
))))
self
.
min
.
append
(
max
(
map
(
lambda
x
:
x
[
0
]
if
x
[
1
]
else
0
,
enumerate_prop
)))
sum_prop
=
sum
(
prop
)
avg
=
sum
(
map
(
lambda
x
:
x
[
0
]
*
x
[
1
],
enumerate_prop
))
/
sum_prop
var
=
0
for
x
,
p
in
enumerate_prop
:
var
+=
p
*
x
**
2
var
/=
sum_prop
var
-=
avg
**
2
self
.
avg
.
append
(
avg
)
self
.
var
.
append
(
var
)
def
export_to_json
(
self
,
path
):
def
export_to_json
(
self
,
path
):
with
open
(
path
,
'w'
)
as
outfile
:
with
open
(
path
,
'w'
)
as
outfile
:
...
...
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