1
1
var AstiError = require ( './error' ) ( ) ;
2
2
var _ = require ( 'underscore' ) ;
3
3
var memwatch = require ( 'memwatch' ) ;
4
- //var toobusy = require('toobusy');
5
4
6
5
module . exports = function ( config ) {
7
6
return new Monitor ( config ) ;
@@ -35,7 +34,6 @@ var Monitor = function Monitor(config) {
35
34
this . _logger = config . logger . child ( { widget_type : 'health' } ) ;
36
35
}
37
36
this . _interval = config . interval || 2000 ;
38
- this . _lag = config . lag ;
39
37
this . _mem = config . mem ;
40
38
this . _monitorEventLoop ( ) ;
41
39
this . _monitorLeaks ( ) ;
@@ -50,7 +48,7 @@ Monitor.prototype.stopMonitoring = function stopMonitoring() {
50
48
51
49
Monitor . prototype . _monitorLeaks = function _monitorLeaks ( ) {
52
50
if ( this . _mem ) {
53
- memwatch . on ( 'leak' , function leak ( stat ) {
51
+ memwatch . on ( 'leak' , function leak ( ) {
54
52
if ( this . _stats ) {
55
53
this . _stats . increment ( 'leak' ) ;
56
54
}
@@ -75,9 +73,6 @@ Monitor.prototype._stat = function _stat(value, key) {
75
73
Monitor . prototype . _monitorEventLoop = function _monitorEventLoop ( ) {
76
74
var trackMetrics = function trackMetrics ( ) {
77
75
var metrics = { } ;
78
- if ( this . _lag ) {
79
- //metrics.lag = toobusy.lag();
80
- }
81
76
if ( this . _mem ) {
82
77
var memory = process . memoryUsage ( ) ;
83
78
metrics . rss = memory . rss ;
0 commit comments