Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
dream
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
dream
Commits
cf673af9
Commit
cf673af9
authored
Feb 23, 2015
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
statistics for queues in one replication
parent
56833666
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
3 deletions
+23
-3
dream/plugins/BatchesTabularQueues.py
dream/plugins/BatchesTabularQueues.py
+23
-3
No files found.
dream/plugins/BatchesTabularQueues.py
View file @
cf673af9
...
...
@@ -5,6 +5,7 @@ import random
import
operator
import
StringIO
import
xlrd
import
math
from
dream.plugins
import
plugin
...
...
@@ -28,9 +29,28 @@ class BatchesTabularQueues(plugin.OutputPreparationPlugin):
bufferId
=
record
[
'id'
]
wip_stat_list
=
record
[
'results'
][
'wip_stat_list'
][
0
]
bufferLevels
=
[
int
(
x
[
1
])
for
x
in
wip_stat_list
]
minLevel
=
min
(
bufferLevels
)
maxLevel
=
max
(
bufferLevels
)
self
.
createTimeListDict
(
wip_stat_list
,
maxSimTime
)
finalValue
=
wip_stat_list
[
-
1
][
1
]
timeListDict
=
self
.
createTimeListDict
(
wip_stat_list
,
maxSimTime
)
totalLevel
=
0
minLevel
=
float
(
'inf'
)
# count the minimum that has no zero duration
for
level
,
duration
in
timeListDict
.
iteritems
():
if
duration
and
(
level
<
minLevel
):
minLevel
=
level
for
level
,
duration
in
timeListDict
.
iteritems
():
totalLevel
+=
level
*
duration
averageLevel
=
totalLevel
/
float
(
maxSimTime
)
totalDistance
=
0
for
level
,
duration
in
timeListDict
.
iteritems
():
totalDistance
+=
((
level
-
averageLevel
)
*
(
level
-
averageLevel
))
*
duration
stdevLevel
=
math
.
sqrt
(
totalDistance
/
float
(
maxSimTime
-
1
))
data
[
'result'
][
'result_list'
][
-
1
][
'buffer_output'
].
append
([
bufferId
,
finalValue
,
"%.2f"
%
averageLevel
,
"%.2f"
%
stdevLevel
,
minLevel
,
maxLevel
])
elif
numberOfReplications
>
1
:
# create the titles of the columns
pass
...
...
@@ -51,5 +71,5 @@ class BatchesTabularQueues(plugin.OutputPreparationPlugin):
if
not
(
level
in
timeListDict
.
keys
()):
timeListDict
[
level
]
=
0
timeListDict
[
level
]
+=
nextTime
-
time
print
timeListDict
return
timeListDict
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