Private diagnostic method to dump the active watchers

This commit is contained in:
Ash Wilson
2017-08-18 09:08:34 -04:00
parent a0bdc50535
commit e2c9cc1692
2 changed files with 19 additions and 1 deletions

View File

@@ -431,6 +431,14 @@ class NativeWatcherRegistry {
watcher.attachToNative(native, nativePath)
})
}
// Private: Generate a visual representation of the currently active watchers managed by this
// registry.
//
// Returns a {String} showing the tree structure.
print() {
return this.tree.print()
}
}
module.exports = {NativeWatcherRegistry}

View File

@@ -581,6 +581,11 @@ class PathWatcherManager {
return watcher
}
// Private: Return a {String} depicting the currently active native watchers.
print () {
return this.nativeRegistry.print()
}
// Private: Stop all living watchers.
//
// Returns a {Promise} that resolves when all native watcher resources are disposed.
@@ -641,4 +646,9 @@ function stopAllWatchers () {
return PathWatcherManager.instance().stopAllWatchers()
}
module.exports = {watchPath, stopAllWatchers}
// Private: Show the currently active native watchers.
function printWatchers () {
return PathWatcherManager.instance().print()
}
module.exports = {watchPath, stopAllWatchers, printWatchers}