Skip to content

Instantly share code, notes, and snippets.

@tjfontaine
Created February 3, 2014 21:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tjfontaine/8792433 to your computer and use it in GitHub Desktop.
Save tjfontaine/8792433 to your computer and use it in GitHub Desktop.
var restify = tracing.createProvider('restify'); // { namespace: 'anonymous', provider: 'restify', guid: stablehash }
var restify = tracing.createProvider({
namespace: 'joyent',
provider: 'restify',
guid: '12345',
});
restify.addProbe('foo', ['string', 'number', 'integer']);
restify.enable();
restify.listProbes(); // { foo: { signature: [...], } }
restify.disable();
restify.addProbe('foo', ['char*', 'char*', 'char*']);
restify.enable();
restify.fire('foo', function() {
return [foo, bar, baz];
});
function common(args) {
return [args[0].foo, args[1].baz];
}
restify.fire('foo', [blah], common);
tracing.listProviders(); // { joyent: { restify: { foo: { signature: [...], } } } }
tracing.on('joyent', 'restify', 'foo', function(args) {
});
tracing.on('anonymous', 'restify', 'foo', function(args) {
});
tracing.on('*', 'restify', 'foo', function(args) {
});
tracing.on('*', '*', '*', function(args) {
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment