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
542adac4
Commit
542adac4
authored
Feb 22, 2015
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PostProcessQueueStatistics: a plugin to preprocess values for queue statistics widget
parent
30626882
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
0 deletions
+31
-0
dream/plugins/PostProcessQueueStatistics.py
dream/plugins/PostProcessQueueStatistics.py
+31
-0
No files found.
dream/plugins/PostProcessQueueStatistics.py
0 → 100644
View file @
542adac4
from
dream.plugins
import
plugin
from
dream.plugins.TimeSupport
import
TimeSupportMixin
class
PostProcessQueueStatistics
(
plugin
.
OutputPreparationPlugin
,
TimeSupportMixin
):
""" Output the queue statistics in a format compatible with Output_viewGraph
"""
def
postprocess
(
self
,
data
):
self
.
initializeTimeSupport
(
data
)
result
=
data
[
'result'
][
'result_list'
][
-
1
]
series
=
[]
options
=
{
"xaxis"
:
{
"mode"
:
"time"
,
"minTickSize"
:
[
1
,
self
.
getTimeUnitText
()],
}
}
result
[
self
.
configuration_dict
[
'output_id'
]]
=
{
"series"
:
series
,
"options"
:
options
}
for
obj
in
result
[
'elementList'
]:
if
obj
.
get
(
'family'
)
==
self
.
configuration_dict
.
get
(
'family'
,
'Buffer'
):
series
.
append
({
"label"
:
obj
.
get
(
'name'
,
obj
[
'id'
]),
"data"
:
[(
self
.
convertToTimeStamp
(
time
)
*
1000
,
value
)
for
(
time
,
value
)
in
obj
[
'results'
][
'wip_stat_list'
][
0
]]
})
return
data
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