@@ -56,9 +56,8 @@ var Instrumentation = function(core, options, callback) {
56
56
var instrumentations = [ ]
57
57
58
58
// Classes to support
59
- var classes = [ GridStore , Server , ReplSet , Mongos ,
60
- OrderedBulkOperation , UnorderedBulkOperation , CommandCursor , AggregationCursor ,
61
- Cursor , Collection , Db ] ;
59
+ var classes = [ GridStore , OrderedBulkOperation , UnorderedBulkOperation ,
60
+ CommandCursor , AggregationCursor , Cursor , Collection , Db ] ;
62
61
63
62
// Add instrumentations to the available list
64
63
for ( var i = 0 ; i < classes . length ; i ++ ) {
@@ -375,7 +374,6 @@ var Instrumentation = function(core, options, callback) {
375
374
return self . emit ( 'succeeded' , command )
376
375
}
377
376
378
-
379
377
// Add our callback handler
380
378
args . push ( function ( err , r ) {
381
379
if ( err ) {
@@ -464,6 +462,11 @@ Instrumentation.prototype.uninstrument = function() {
464
462
var obj = this . overloads [ i ] ;
465
463
obj . proto [ obj . name ] = obj . func ;
466
464
}
465
+
466
+ // Remove all listeners
467
+ this . removeAllListeners ( 'started' ) ;
468
+ this . removeAllListeners ( 'succeeded' ) ;
469
+ this . removeAllListeners ( 'failed' ) ;
467
470
}
468
471
469
472
module . exports = Instrumentation ;
0 commit comments