File tree 5 files changed +517431
-4
lines changed
5 files changed +517431
-4
lines changed Original file line number Diff line number Diff line change
1
+
2
+
3
+ // CPU Profiling
1
4
// require('./monitoring/CpuProfiler').init('./public/metrics');
5
+
6
+ // Heap Dumps and Metrics
2
7
// require('./monitoring/HeapDump').init('./public/metrics');
3
- var createNamespace = require ( 'continuation-local' + '-storage' ) . createNamespace ;
4
- var asyncCallbackMiddleware = require ( './monitoring/AsyncCallbackMiddleware' ) ;
8
+
9
+ // See below for callback timings
5
10
6
11
7
12
@@ -19,7 +24,9 @@ var todo = require('./routes/todo');
19
24
20
25
var app = express ( ) ;
21
26
22
- // Switch on callback listener
27
+ // Callback timings
28
+ var asyncCallbackMiddleware = require ( './monitoring/AsyncCallbackMiddleware' ) ;
29
+ var createNamespace = require ( 'continuation-local' + '-storage' ) . createNamespace ;
23
30
app . use ( asyncCallbackMiddleware ) ;
24
31
25
32
// view engine setup
Original file line number Diff line number Diff line change @@ -10,6 +10,14 @@ var fs = require('fs');
10
10
var profiler = require ( 'v8-profiler' ) ;
11
11
var _datadir = null ;
12
12
var nextMBThreshold = 0 ;
13
+ var gcprofiler = require ( 'gc-profiler' ) ;
14
+
15
+ // Listen to GC events
16
+ gcprofiler . on ( 'gc' , function ( info ) {
17
+ console . log ( 'GC happened' ) ;
18
+ console . log ( info ) ;
19
+ } ) ;
20
+
13
21
14
22
/**
15
23
* Init and scheule heap dump runs
Original file line number Diff line number Diff line change 11
11
"cookie-parser" : " ~1.3.5" ,
12
12
"debug" : " ~2.2.0" ,
13
13
"express" : " ~4.12.4" ,
14
+ "gc-profiler" : " ^1.2.0" ,
14
15
"jade" : " ~1.9.2" ,
15
16
"less-middleware" : " 1.0.x" ,
16
17
"morgan" : " ~1.5.3" ,
You can’t perform that action at this time.
0 commit comments