Commit c241776d authored by Jérome Perrin's avatar Jérome Perrin

New output widget showing a graph of queue lenghts

parent 47a49af9
......@@ -264,6 +264,16 @@ path, ._jsPlumb_endpoint {
margin-top:0px;
}
#queue_stat_graph {
width: 70%;
height: 250px;
text-align: center;
margin-left:auto;
margin-right:auto;
padding-top:2px;
margin-top:0px;
}
.ui-button {
width:80%;
margin:4px 0;
......
......@@ -74,6 +74,10 @@
<div id="graph"></div>
</div>
<div id="exit_stat"></div>
<div id="queue_stat">
<div>Queues Statistics</div>
<div id="queue_stat_graph"></div>
</div>
<div id="job_gantt" style='width:1320px; height:800px;'></div>
<div id="job_schedule_spreadsheet" style="display: none; overflow: scroll;"></div>
......
......@@ -517,6 +517,18 @@
$.plot("#graph", series, options);
}
if (configuration['Dream-Configuration'].gui.queue_stat){
var queue_stat = $("#queue_stat").show();
var series = [];
$.each(result.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);
}
if (configuration['Dream-Configuration'].gui.exit_stat){
var exit_stat = $("#exit_stat").show().text("Exit Metrics");
$.each(result.elementList, function(idx, el){
......
......@@ -69,6 +69,7 @@
$('#job_schedule_spreadsheet').hide();
$('#shift_spreadsheet').hide();
$("#job_gantt").hide();
$("#queue_stat").hide();
$("#wip_part_spreadsheet").hide();
if (configuration['Dream-Configuration'].gui.wip_part_spreadsheet){
......
......@@ -275,7 +275,13 @@ class Simulation(object):
"property_list": [schema["capacity"]],
"_class": 'Dream.Repairman'
},
"Dream-EventGenerator": {
"name": "Event Generator",
"short_id": "EG",
"property_list": [schema['start'], schema['stop'], schema['duration'],
schema['interval'], schema['method'], schema['argumentDict']],
"_class": "Dream.EventGenerator",
},
# global configuration
"Dream-Configuration": {
"property_list": [
......@@ -296,6 +302,7 @@ class Simulation(object):
'job_schedule_spreadsheet': 0,
'job_gantt': 0,
'exit_stat': 1,
'queue_stat': 1,
},
"_class": 'Dream.Configuration'
},
......
......@@ -194,6 +194,11 @@ def countIntervalThroughput(argumentDict={}):
previouslyExited=sum(obj.intervalThroughPutList)
currentExited+=totalExited-previouslyExited
obj.intervalThroughPutList.append(currentExited)
from Queue import Queue
def countQueueMetrics(argumentDict={}):
for obj in G.ObjList:
if isinstance(obj, Queue):
obj.wip_stat_list.append((now(), len(obj.Res.activeQ)))
......@@ -72,6 +72,9 @@ class Queue(CoreObject):
raise ValueError("Unknown scheduling rule %s for %s" %
(scheduling_rule, id))
# Will be populated by an event generator
self.wip_stat_list = []
@staticmethod
def getSupportedSchedulingRules():
return ("FIFO", "Priority", "EDD", "EOD",
......@@ -292,4 +295,8 @@ class Queue(CoreObject):
from Globals import G
json = {'_class': 'Dream.%s' % self.__class__.__name__,
'id': str(self.id), }
# XXX this have to be updated to support multiple generations
if G.numberOfReplications == 1 and self.wip_stat_list:
json['wip_stat_list'] = self.wip_stat_list
G.outputJSON['elementList'].append(json)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment