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
a1bc007a
Commit
a1bc007a
authored
Jun 05, 2014
by
Romain Courteaud
Committed by
Jérome Perrin
Aug 11, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate queue statistics graph
parent
a81401f1
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
95 additions
and
22 deletions
+95
-22
dream/platform/src/index.html
dream/platform/src/index.html
+0
-6
dream/platform/src/src/dream.js
dream/platform/src/src/dream.js
+1
-15
dream/platform/src2/dream/document_page_mixin.js
dream/platform/src2/dream/document_page_mixin.js
+6
-1
dream/platform/src2/dream/queue_stat_graph.html
dream/platform/src2/dream/queue_stat_graph.html
+17
-0
dream/platform/src2/dream/queue_stat_graph.js
dream/platform/src2/dream/queue_stat_graph.js
+71
-0
No files found.
dream/platform/src/index.html
View file @
a1bc007a
...
...
@@ -75,7 +75,6 @@
<li><a
href=
"#station_utilisation_graph"
>
Stations Utilization
</a></li>
<li><a
href=
"#capacity_utilisation_graph"
>
Capacity Utilization
</a></li>
<li><a
href=
"#exit_stat"
>
Exit Statistics
</a></li>
<li><a
href=
"#queue_stat"
>
Queue Statistics
</a></li>
<li><a
href=
"#job_gantt"
>
Job Gantt
</a></li>
<li><a
href=
"#job_schedule_spreadsheet"
>
Job Schedule
</a></li>
</ul>
...
...
@@ -90,11 +89,6 @@
<div></div>
</div>
<div
id=
"queue_stat"
>
<h1>
Queues Statistics
</h1>
<div
id=
"queue_stat_graph"
></div>
</div>
<div
id=
"job_gantt"
style=
'width:1320px; height:800px;'
></div>
<div
id=
"job_schedule_spreadsheet"
style=
"overflow: scroll;"
></div>
...
...
dream/platform/src/src/dream.js
View file @
a1bc007a
...
...
@@ -23,6 +23,7 @@
"
use strict
"
;
function
capacity_utilisation_graph_widget
(
input_data
,
output_data
)
{
var
available_capacity_by_station
=
{},
capacity_usage_by_station
=
{};
...
...
@@ -91,21 +92,6 @@
}
};
function
queue_stat_widget
(
input_data
,
output_data
)
{
/* FIXME: does not support more than one replic.
* + see george email to integrate without the need of an EG
*/
var
queue_stat
=
$
(
"
#queue_stat
"
);
var
series
=
[];
$
.
each
(
output_data
.
elementList
,
function
(
idx
,
el
){
if
(
el
.
_class
==
'
Dream.Queue
'
){
series
.
push
({
label
:
el
.
name
||
el
.
id
,
data
:
el
.
wip_stat_list
})
}
})
$
.
plot
(
"
#queue_stat_graph
"
,
series
);
}
function
exit_stat_widget
(
input_data
,
output_data
)
{
var
exit_stat
=
$
(
"
#exit_stat
"
).
find
(
'
div
'
).
empty
();
$
.
each
(
output_data
.
elementList
,
function
(
idx
,
el
){
...
...
dream/platform/src2/dream/document_page_mixin.js
View file @
a1bc007a
...
...
@@ -21,6 +21,10 @@
"
station_utilisation_graph
"
,
key
),
gadget
.
whoWantToDisplayThisDocumentPage
(
"
queue_stat_graph
"
,
key
),
gadget
.
whoWantToDisplayThisDocumentPage
(
"
debug_json
"
,
key
)
]);
})
...
...
@@ -30,7 +34,8 @@
{
link
:
result_list
[
1
],
title
:
"
Run simulation
"
},
{
link
:
result_list
[
2
],
title
:
"
Manage document
"
},
{
link
:
result_list
[
3
],
title
:
"
Stations Utilization
"
},
{
link
:
result_list
[
4
],
title
:
"
Debug JSON
"
}
{
link
:
result_list
[
4
],
title
:
"
Queues Statistics
"
},
{
link
:
result_list
[
5
],
title
:
"
Debug JSON
"
}
];
});
});
...
...
dream/platform/src2/dream/queue_stat_graph.html
0 → 100644
View file @
a1bc007a
<!DOCTYPE html>
<html>
<head>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<title>
Queues Statistics
</title>
<script
src=
"../<%= copy.rsvp.relative_dest %>"
type=
"text/javascript"
></script>
<script
src=
"../<%= copy.renderjs.relative_dest %>"
type=
"text/javascript"
></script>
<script
src=
"../<%= curl.jqueryflot.relative_dest %>"
></script>
<script
src=
"../<%= curl.jqueryflotstack.relative_dest %>"
></script>
<script
src=
"document_page_mixin.js"
type=
"text/javascript"
></script>
<script
src=
"queue_stat_graph.js"
type=
"text/javascript"
></script>
</head>
<body>
<div
class=
"graph_container"
style=
"width: 100%;height:300px"
></div>
</body>
</html>
dream/platform/src2/dream/queue_stat_graph.js
0 → 100644
View file @
a1bc007a
/*global console, rJS, RSVP, initDocumentPageMixin, jQuery */
/*jslint nomen: true */
(
function
(
window
,
rJS
,
RSVP
,
initDocumentPageMixin
,
$
)
{
"
use strict
"
;
function
queue_stat_widget
(
output_data
)
{
/* FIXME: does not support more than one replic.
* + see george email to integrate without the need of an EG
*/
var
series
=
[];
$
.
each
(
output_data
.
elementList
,
function
(
idx
,
el
)
{
if
(
el
.
_class
===
'
Dream.Queue
'
)
{
series
.
push
({
label
:
el
.
name
||
el
.
id
,
data
:
el
.
wip_stat_list
});
}
});
return
series
;
}
var
gadget_klass
=
rJS
(
window
);
initDocumentPageMixin
(
gadget_klass
);
gadget_klass
/////////////////////////////////////////////////////////////////
// ready
/////////////////////////////////////////////////////////////////
// Init local properties
.
ready
(
function
(
g
)
{
g
.
props
=
{};
})
// Assign the element to a variable
.
ready
(
function
(
g
)
{
return
g
.
getElement
()
.
push
(
function
(
element
)
{
g
.
props
.
element
=
element
;
});
})
/////////////////////////////////////////////////////////////////
// Acquired methods
/////////////////////////////////////////////////////////////////
.
declareAcquiredMethod
(
"
aq_getAttachment
"
,
"
jio_getAttachment
"
)
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
.
declareMethod
(
"
render
"
,
function
(
options
)
{
var
jio_key
=
options
.
id
,
gadget
=
this
;
gadget
.
props
.
jio_key
=
jio_key
;
return
gadget
.
aq_getAttachment
({
"
_id
"
:
gadget
.
props
.
jio_key
,
"
_attachment
"
:
"
simulation.json
"
})
.
push
(
function
(
simulation_json
)
{
gadget
.
props
.
series
=
queue_stat_widget
(
// XXX Hardcoded result
JSON
.
parse
(
simulation_json
)[
0
].
result
);
});
})
.
declareMethod
(
"
startService
"
,
function
()
{
// XXX Manually calculate width and height when resizing
$
.
plot
(
this
.
props
.
element
.
querySelector
(
"
.graph_container
"
),
this
.
props
.
series
);
});
}(
window
,
rJS
,
RSVP
,
initDocumentPageMixin
,
jQuery
));
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