Update to make dtrace-provider optional.
This commit is contained in:
parent
d20308265a
commit
a84546b7bd
|
@ -79,7 +79,28 @@ var SERVER_PROBES = {
|
|||
|
||||
module.exports = function () {
|
||||
if (!SERVER_PROVIDER) {
|
||||
SERVER_PROVIDER = dtrace.createDTraceProvider('ldapjs');
|
||||
try {
|
||||
var dtrace = require('dtrace-provider');
|
||||
SERVER_PROVIDER = dtrace.createDTraceProvider('restify');
|
||||
} catch (e) {
|
||||
SERVER_PROVIDER = {
|
||||
fire: function () {
|
||||
},
|
||||
enable: function () {
|
||||
},
|
||||
addProbe: function () {
|
||||
var p = {
|
||||
fire: function () {
|
||||
}
|
||||
};
|
||||
return (p);
|
||||
},
|
||||
removeProbe: function () {
|
||||
},
|
||||
disable: function () {
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Object.keys(SERVER_PROBES).forEach(function (p) {
|
||||
var args = SERVER_PROBES[p].splice(0);
|
||||
|
|
|
@ -30,10 +30,12 @@
|
|||
"asn1": "0.1.11",
|
||||
"assert-plus": "0.1.2",
|
||||
"bunyan": "0.21.1",
|
||||
"dtrace-provider": "0.2.8",
|
||||
"nopt": "2.1.1",
|
||||
"pooling": "0.4.5"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"dtrace-provider": "0.2.8"
|
||||
},
|
||||
"devDependencies": {
|
||||
"tap": "0.4.1",
|
||||
"node-uuid": "1.4.0"
|
||||
|
|
Loading…
Reference in New Issue