Free cookie consent management tool by TermsFeed Policy Generator

source: branches/OaaS/HeuristicLab.Services.Optimization.Web/Content/job.controller.js @ 14595

Last change on this file since 14595 was 9508, checked in by fschoepp, 12 years ago

#1888:
HL:

  • Web projects requires different users to interact with hive. The singleton HiveServiceLocator.Instance doesn't allow different users at the same time, resulting in serialization during access of HiveClient methods.

The following changes have been introduced in favor of a parallel use of the HL libs:

  • HiveClient, TaskDownloader and ConcurrentTaskDownloader may now use a different IHiveServiceLocator than HiveServiceLocator.Instance (all methods have appropriate overloads now).
  • The default instance is still HiveServiceLocator.Instance.

Automated Scaling of Instances:

  • Added Scaler project to solution which represents a WorkerRole that scales the slave instances based on the global cpu utilization of all slaves.
  • Scaler is based on WASABi, rules can be adjusted in rulesstore.xml. Basic rule is: if < 45% global cpu utilization => remove an instance; if > 65% cpu => add an instance. Minimum boundary is 1 and maximum boundary is 8 slave instances.
  • Adjusted Slave project to automatically register itself to a SlaveGroup during WebRole startup (can be adjusted in service configuration).

Web-Frontend:

  • Added basic error messages to the dialogs when an ajax call fails.
  • Removed Styling.js from scripts.
File size: 3.1 KB
RevLine 
[9324]1var OAAS_CONTROLLER = (function (my, Backbone, OAAS_VIEW, OAAS_MODEL, _, $) {
[9395]2    my.JobVisualExtensionListener = function (model, element) {
3        var extension = new OAAS_MODEL.VisualExtension({ id: model.get('algorithmName') });
[9508]4        extension.fetch({ cache: true,
5            success: function () {
6                //eval extension.js -> execute addVisualExtension(model, element):
7                var js = extension.get('ScenarioJs');
8                if (js != null) {
9                    (function (model, element) {
10                        addExtension = undefined;
11                        eval(js);
12                        if (addExtension)
13                            addExtension(model, element);
14                    } (model, element));
15                }
16            },
17            error: function (model, response, options) {
18               
[9395]19            }
20        });
21    },
[9324]22    my.JobPageController = function () {
23        this.create = function () {
24            var self = this;
25            var jobList = new OAAS_MODEL.JobList();
26            var jobOverview = new OAAS_VIEW.JobOverView({ collection: jobList, el: $('#jobOverview') });
27
28            var listener = {};
29            // add listener capabilities to instance
30            _.extend(listener, Backbone.Events);
31
32            listener.listenTo(jobList, 'updated', function (evt) {
33                // refresh overview
34                jobOverview.render();
35            });
36
37            listener.listenTo(jobOverview, 'jobSelected', function (jobId) {
38                var runList = new OAAS_MODEL.RunList({ jobId: jobId });
39                var lv = new OAAS_VIEW.LoadingView({ el: $('#jobDetails'), model: 'Loading results of job...' });
40                lv.render();
[9508]41                runList.fetch({ cache: false,
42                    success: function () {
43                        $('#jobDetails').empty();
44                        var div = $('<div/>').appendTo($('#jobDetails'));
45                        if (runList.models && runList.models.length == 0) {
46                            $('<p/>').text('No job results available!').appendTo(div);
47                            return;
48                        }
49                        // else draw the result view
50                        var rv = new OAAS_VIEW.ResultView({ model: runList, el: div });
51                        listener.listenTo(rv, 'renderVisualExtension', my.JobVisualExtensionListener);
52                        rv.render();
53                        var av = new OAAS_VIEW.AccordionView({ el: div });
54                        av.render();
55                    },
56                    error: function (model, response, options) {
57                        $('#jobDetails').empty();
58                        var lv = new OAAS_VIEW.LoadingView({ el: $('#jobDetails'), model: 'Error during retrieval!' });
59                        lv.render();
60                    }
[9324]61                });
62            });
63
[9395]64
65
[9324]66            jobList.poll();
67        }
68    }
69    return my;
70} (OAAS_CONTROLLER || {}, Backbone, OAAS_VIEW, OAAS_MODEL, _, $));
Note: See TracBrowser for help on using the repository browser.