use monitor as a service

This commit is contained in:
Iuri Matias 2018-06-01 12:27:12 -04:00
parent 37d54e22db
commit eadbeb0498
2 changed files with 13 additions and 12 deletions

View File

@ -71,15 +71,6 @@ class Engine {
}; };
} }
startMonitor() {
const self = this;
this.servicesMonitor = new ServicesMonitor({events: this.events, logger: this.logger, plugins: this.plugins});
this.servicesMonitor.addCheck('embarkVersion', function (cb) {
return cb({name: 'Embark ' + self.version, status: 'on'});
}, 0);
this.servicesMonitor.startMonitor();
}
registerModule(moduleName, options) { registerModule(moduleName, options) {
this.plugins.loadInternalPlugin(moduleName, options || {}); this.plugins.loadInternalPlugin(moduleName, options || {});
} }
@ -88,6 +79,7 @@ class Engine {
let options = _options || {}; let options = _options || {};
let services = { let services = {
"serviceMonitor": this.serviceMonitor,
"pipeline": this.pipelineService, "pipeline": this.pipelineService,
"codeRunner": this.codeRunnerService, "codeRunner": this.codeRunnerService,
"codeGenerator": this.codeGeneratorService, "codeGenerator": this.codeGeneratorService,
@ -134,6 +126,15 @@ class Engine {
}); });
} }
serviceMonitor() {
const self = this;
this.servicesMonitor = new ServicesMonitor({events: this.events, logger: this.logger, plugins: this.plugins});
this.servicesMonitor.addCheck('embarkVersion', function (cb) {
return cb({name: 'Embark ' + self.version, status: 'on'});
}, 0);
this.servicesMonitor.startMonitor();
}
namingSystem(_options) { namingSystem(_options) {
this.registerModule('ens'); this.registerModule('ens');
} }

View File

@ -114,7 +114,7 @@ class Embark {
engine.logger.info(__("loaded plugins") + ": " + pluginList.join(", ")); engine.logger.info(__("loaded plugins") + ": " + pluginList.join(", "));
} }
engine.startMonitor(); engine.startService("serviceMonitor");
engine.startService("libraryManager"); engine.startService("libraryManager");
engine.startService("codeRunner"); engine.startService("codeRunner");
engine.startService("web3"); engine.startService("web3");
@ -238,7 +238,7 @@ class Embark {
engine.logger.info(__("loaded plugins") + ": " + pluginList.join(", ")); engine.logger.info(__("loaded plugins") + ": " + pluginList.join(", "));
} }
engine.startMonitor(); engine.startService("serviceMonitor");
engine.startService("libraryManager"); engine.startService("libraryManager");
engine.startService("pipeline"); engine.startService("pipeline");
engine.startService("deployment", {onlyCompile: true}); engine.startService("deployment", {onlyCompile: true});
@ -300,7 +300,7 @@ class Embark {
function startServices(callback) { function startServices(callback) {
engine.startMonitor(); engine.startService("serviceMonitor");
engine.startService("libraryManager"); engine.startService("libraryManager");
engine.startService("codeRunner"); engine.startService("codeRunner");
engine.startService("web3"); engine.startService("web3");