New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

newrelic

Package Overview
Dependencies
Maintainers
3
Versions
394
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

newrelic - npm Package Compare versions

Comparing version 1.11.0 to 1.11.1

4

CONTRIBUTING.md

@@ -35,4 +35,4 @@ # Guidelines for contributing code

There are some other tests in `test/multiverse/` and `test/versioned-node/`.
They are works in progress and not ready for general-purpose use.
There are some other tests in `test/versioned-node/`. They are works in progress
and not ready for general-purpose use.

@@ -39,0 +39,0 @@

@@ -1,14 +0,12 @@

"use strict";
'use strict';
var path = require('path')
, ParsedStatement = require(path.join(__dirname, '..', 'db', 'parsed-statement'))
, shimmer = require(path.join(__dirname, '..', 'shimmer'))
, urltils = require(path.join(__dirname, '..', 'util', 'urltils.js'))
, logger = require(path.join(__dirname, '..',
'logger')).child({component : 'mongodb'})
, MONGODB = require(path.join(__dirname, '..', 'metrics', 'names')).MONGODB
, ParsedStatement = require('../db/parsed-statement')
, shimmer = require('../shimmer')
, urltils = require('../util/urltils')
, logger = require('../logger').child({component : 'mongodb'})
, MONGODB = require('../metrics/names').MONGODB
;
var INSTRUMENTED_OPERATIONS = [
'find',
var COLLECTION_OPERATIONS = [
'findOne',

@@ -31,53 +29,199 @@ 'insert',

/**
* Everything uses nextObject, whether you're streaming or using callbacks.
* Mongo operations fall into two categories: cursor and collection operations.
* Cursor operations iterate through query results. This includes
* Cursor.toArray(), .each(), and .nextObject(). Collection operations are those
* called on collection objects.
*
* @param {TraceSegment} segment The current segment, to be closed when done.
* @param {Tracer} tracer The current transaction trcer.
* In particular, both cursor and collection operations may be called by parent
* collection operations. Cursor.nextObject() may also be called within any of
* the cursor operations.
*
* @returns {Function} A callback that further wraps the callback called by the
* wrapped nextObject method, so we can tell when the cursor
* is exhausted.
* The following functions return whether the current segment is any MongoDB
* operation, a cusor operation, or a collection operation.
*/
function wrapNextObject(tracer) {
return function cls_wrapNextObject(nextObject) {
return function wrappedNextObject() {
if (!tracer.getTransaction()) return nextObject.apply(this, arguments);
var MONGO_RE = new RegExp('^' + MONGODB.STATEMENT);
function isCurrentSegmentMongo(tracer) {
var segment = tracer.getSegment();
return MONGO_RE.test(segment.name);
}
var args = tracer.slice(arguments)
, last = args.length - 1
, callback = args[last]
, cursor = this
;
var CURSOR_RE = new RegExp('^' + MONGODB.STATEMENT + '.*/find$');
function isCurrentSegmentCursorOp(tracer) {
var segment = tracer.getSegment();
return CURSOR_RE.test(segment.name);
}
if (typeof callback === 'function' && cursor.collection) {
args[last] = tracer.callbackProxy(function cb_callbackProxy(err, object) {
var collection = cursor.collection.collectionName || 'unknown'
, remaining = cursor.items.length
, total = cursor.totalNumberOfRecords
, limit = cursor.limitValue === -1 ? 1 : cursor.limitValue
, returned = callback.apply(this, arguments)
, segment = tracer.getSegment()
;
var COLLECTION_RE = new RegExp('^' + MONGODB.STATEMENT + '(?!.*\/find$)');
function isCurrentSegmentCollectionOp(tracer) {
var segment = tracer.getSegment();
return COLLECTION_RE.test(segment.name);
}
if (remaining === 0 && limit === total) {
segment.end();
logger.trace("MongoDB query trace segment ended for %s: end of batch.",
collection);
}
else if (!object ) {
segment.end();
logger.trace("MongoDB query trace segment ended for %s: nothing to pull.",
collection);
}
/**
* Since collection operations may call other collection operations under the
* covers, we must distinguish between the two following scenarios:
*
* - findAndRemove() calls findAndModify() under the covers
* - Callback of operation calls a new operation
*
* The way to tell is to track whether the first collection operation has
* completed and is in a callback when the second operation begins.
*
* The following function returns whether the current segment has finished
* the transaction and is now in a callback.
*/
function isCurrentSegmentInCallbackState(tracer) {
return tracer.getSegment().isInCallbackState();
}
/* each time the cursor is called, update the prospective end time
* for the MongoDB cursor
*/
segment.touch();
/**
* There's the possibility that one cursor operation spawns another cursor
* operation. We must distinguish between the two following scenarios:
*
* - nextObject() callback calls nextObject() again to iterate through the
* same query results.
* - nextObject() callback issues a new query and cursor operation
*
* To distinguish between the two, we track whether we are already monitoring a
* given cursor operation.
*
* The following functions enable registering, deregistering, and checking if we
* are tracking a cursor operation.
*/
var cursorTracker = (function CursorTracker() {
var activeCursors = {};
var nextCursorId = 1;
return returned;
});
return {
track: function track(cursor, segment) {
if (!cursor.__NR_segment_id) cursor.__NR_segment_id = nextCursorId++;
activeCursors[cursor.__NR_segment_id] = segment;
},
untrack: function untrack(cursor) {
if (cursor.__NR_segment_id) {
delete activeCursors[cursor.__NR_segment_id];
delete cursor.__NR_segment_id;
}
},
return nextObject.apply(this, args);
trackedSegment: function trackedSegment(cursor) {
return cursor.__NR_segment_id && activeCursors[cursor.__NR_segment_id];
}
};
}());
/**
* Wrap Cursor iterator operations as results can be returned in a callback.
*
* @param {Tracer} tracer The current transaction tracer.
* @param {string} operation The name of the Cursor operation
*
* @returns {Function} A CLS wrapped callback.
*/
function wrapCursorOperation(tracer, operationName) {
return function cls_wrapCursorOperation(operation) {
return tracer.segmentProxy(function mongoCursorOperationProxy() {
var cursor = this;
var collection = cursor.collection.collectionName;
var terms = cursor.selector;
if (!tracer.getTransaction()) {
logger.trace('Not tracing MongoDB %s.%s(%j); no New Relic transaction.',
collection, operationName, terms);
return operation.apply(this, arguments);
}
var args = tracer.slice(arguments);
var last = args.length - 1;
var callback = args[last];
if (typeof callback !== 'function') {
logger.trace('Not tracing MongoDB %s.%s(%j); last argument was not a callback.',
collection, operationName, terms);
return operation.apply(this, arguments);
}
// Conditions in which we allow a cursor operation to be tracked as a
// segment:
//
// - Current segment isn't a MongoDB segment
// - Current segment is a collection operation, but it has finished and
// we are now in its callback
// - Current segment is a cursor operation, but this is operation is for a
// cursor we don't already track
var currentIsntMongo = !isCurrentSegmentMongo(tracer);
var currentIsCollectionOperationInCallback = (
isCurrentSegmentCollectionOp(tracer) &&
isCurrentSegmentInCallbackState(tracer)
);
var currentIsCursorOperationAndThisCursorIsNew = (
isCurrentSegmentCursorOp(tracer) &&
!cursorTracker.trackedSegment(cursor)
);
if (currentIsntMongo ||
currentIsCollectionOperationInCallback ||
currentIsCursorOperationAndThisCursorIsNew) {
logger.trace('Tracing MongoDB %s.%s(%j).', collection, operation, terms);
addMongoStatement(tracer, collection, 'find');
var segment = tracer.getSegment();
cursorTracker.track(cursor, segment);
// capture configuration information if available
if (cursor.db && cursor.db.serverConfig) {
segment.host = cursor.db.serverConfig.host;
segment.port = cursor.db.serverConfig.port;
}
} else {
logger.trace('Not tracing MongoDB %s.%s(%j); MongoDB segment already in progress.',
collection, operationName, terms);
}
args[last] = tracer.callbackProxy(function cursorOperationCbProxy() {
var ret = callback.apply(this, arguments);
// If we are monitoring this segment/cursor and the cursor is now
// closed, end the transaction. We have to check this because the driver
// in many cases moves a cursor to the closed state without actually
// calling Cursor.close().
var segment = cursorTracker.trackedSegment(cursor);
if (segment && cursor.state === cursor.constructor.CLOSED) {
logger.trace('Tracing MongoDB %s.%s(%j) ended.',
collection, operation, terms);
cursorTracker.untrack(cursor);
segment.end();
}
return ret;
});
operation.apply(this, args);
});
}
}
/**
* When Cursor.close() is called, the cursor is done and any associated segments
* should be ended. Cursor.close() may be called by the consumer of the driver
* as part of the API, or through internal calls as part of results processing.
*/
function wrapCursorClose(tracer) {
return function cls_wrapCursorClose(close) {
return function wrappedCursorClose() {
var cursor = this;
var segment = cursorTracker.trackedSegment(cursor);
if (segment) {
logger.trace('Tracing MongoDB ended via Cursor.close().');
cursorTracker.untrack(cursor);
segment.end();
}
return close.apply(this, arguments);
};

@@ -103,6 +247,16 @@ };

shimmer.wrapMethod(mongodb.Cursor.prototype,
'mongodb.Cursor.prototype', 'nextObject', wrapNextObject(tracer));
'mongodb.Cursor.prototype',
'toArray', wrapCursorOperation(tracer, 'toArray'));
shimmer.wrapMethod(mongodb.Cursor.prototype,
'mongodb.Cursor.prototype',
'each', wrapCursorOperation(tracer, 'each'));
shimmer.wrapMethod(mongodb.Cursor.prototype,
'mongodb.Cursor.prototype',
'nextObject', wrapCursorOperation(tracer, 'nextObject'));
shimmer.wrapMethod(mongodb.Cursor.prototype,
'mongodb.Cursor.prototype',
'close', wrapCursorClose(tracer));
}
INSTRUMENTED_OPERATIONS.forEach(function cb_forEach(operation) {
COLLECTION_OPERATIONS.forEach(function cb_forEach(operation) {
shimmer.wrapMethod(mongodb.Collection.prototype,

@@ -117,3 +271,3 @@ 'mongodb.Collection.prototype', operation, function cls_MONGO_OPERATION(command) {

if (args.length < 1) {
logger.trace("Not tracing MongoDB %s.%s(); no command parameters.",
logger.trace('Not tracing MongoDB %s.%s(); no command parameters.',
collection, operation);

@@ -124,5 +278,5 @@

else if (!tracer.getTransaction()) {
logger.trace("Not tracing MongoDB %s.%s(); no New Relic transaction.",
logger.trace('Not tracing MongoDB %s.%s(); no New Relic transaction.',
collection, operation);
if (terms) logger.trace({terms : terms}, "With terms:");
if (terms) logger.trace({terms : terms}, 'With terms:');

@@ -132,11 +286,9 @@ return command.apply(this, arguments);

logger.trace("Tracing MongoDB %s.%s(%j).", collection, operation, terms);
// Don't add segments when MongoDB is calling back into itself
// internally.
if (!isCurrentSegmentCollectionOp(tracer) ||
isCurrentSegmentInCallbackState(tracer)) {
logger.trace('Tracing MongoDB %s.%s(%j).', collection, operation,
terms);
/* Don't add segments when MongoDB is calling back into itself.
* Mildly heuristic: MongoDB operations that self-call do so on the
* same tick, so if a MongoDB operation has already happened this
* tick (according to the tracer), then it's a self-call.
*/
if (!tracer.isCurrentSegmentType(MONGODB.PREFIX)) {
tracer.setCurrentSegmentType(MONGODB.PREFIX);
var transaction = tracer.getTransaction()

@@ -159,26 +311,26 @@ , segment = addMongoStatement(tracer, collection, operation)

args.push(callback);
if (operation !== 'find') {
args.push(tracer.callbackProxy(function cb_callbackProxy() {
segment.end();
logger.trace("Tracing MongoDB %s.%s(%j) ended for transaction %s.",
collection, operation, terms, transaction.id);
}));
}
args.push(tracer.callbackProxy(function cb_callbackProxy() {
segment.moveToCallbackState();
segment.end();
logger.trace('Tracing MongoDB %s.%s(%j) ended.',
collection, operation, terms);
}));
}
else {
if (operation === 'find') {
args.push(tracer.callbackProxy(callback));
}
else {
args.push(tracer.callbackProxy(function cb_callbackProxy() {
var returned = callback.apply(this, arguments);
args.push(tracer.callbackProxy(function cb_callbackProxy() {
segment.moveToCallbackState();
segment.end();
logger.trace("Tracing MongoDB %s.%s(%j) ended for transaction %s.",
collection, operation, terms, transaction.id);
var returned = callback.apply(this, arguments);
return returned;
}));
}
segment.end();
logger.trace('Tracing MongoDB %s.%s(%j) ended.',
collection, operation, terms);
return returned;
}));
}
} else {
logger.trace('Not tracing MongoDB %s.%s(%j); MongoDB segment already in progress.',
collection, operation, terms);
}

@@ -185,0 +337,0 @@

@@ -10,2 +10,7 @@ 'use strict';

var STATE = {
EXTERNAL: 'EXTERNAL',
CALLBACK: 'CALLBACK',
};
/**

@@ -45,4 +50,13 @@ * TraceSegments are inserted to track instrumented function calls. Each one is

this.port = null;
this.state = STATE.EXTERNAL;
}
TraceSegment.prototype.moveToCallbackState = function moveToCallbackState() {
this.state = STATE.CALLBACK;
}
TraceSegment.prototype.isInCallbackState = function isInCallbackState() {
return this.state === STATE.CALLBACK;
}
/**

@@ -49,0 +63,0 @@ * Once a transaction is named, the web segment also needs to be updated to

@@ -15,3 +15,2 @@ 'use strict';

, TRACER = '__NR_tracer'
, TYPE = '__NR_segment_type'
;

@@ -308,34 +307,2 @@

/**
* Some instrumented modules make self calls from instrumented functions to
* instrumented functions. Because developers can't do anything about these
* subsidiary calls, and in most cases won't even know they're there, it
* doesn't make sense to put them on the transaction trace. The instrumentation
* needs a way to determine whether calls should be ignored or not, and why not
* use CLS to set the current instrumentation type for the rest of the current
* tick?
*
* @param {object} type An opaque identifier for the current segment type.
*/
Tracer.prototype.setCurrentSegmentType = function setCurrentSegmentType(type) {
// only add a cleaner if there isn't one set already
if (!namespace.get(TYPE)) process.nextTick(function cb_nextTick() {
namespace.set(TYPE, undefined);
});
namespace.set(TYPE, type);
};
/**
* Determine whether last segment was of the same type. Doing it this way
* allows synchronous setup calls to alternate between e.g. Redis and MongoDB,
* without stomping on subsidiary calls.
*
* @param {object} type An opaque identifier for the current segment type.
*
* @returns {boolean} Whether the segment types match.
*/
Tracer.prototype.isCurrentSegmentType = function isCurrentSegmentType(type) {
return namespace.get(TYPE) === type;
};
Tracer.prototype.slice = function slice(args) {

@@ -342,0 +309,0 @@ /**

@@ -417,6 +417,4 @@ 'use strict';

Tracer.prototype.bindEmitter = NRTracer.prototype.bindEmitter;
Tracer.prototype.setCurrentSegmentType = NRTracer.prototype.setCurrentSegmentType;
Tracer.prototype.isCurrentSegmentType = NRTracer.prototype.isCurrentSegmentType;
Tracer.prototype.slice = NRTracer.prototype.slice;
module.exports = Tracer;

@@ -0,1 +1,13 @@

### v1.11.1 (2014-09-11)
Fixes:
* Improved MongoDB find instrumentation.
The `mongo` driver provides many different ways to invoke its API and find
documents. In previous releases, some API invocations would create transaction
trace segments that would not end properly, leading to inaccurately large
segment times. This release now covers all the ways to find and iterate
through documents, ensuring segment times are accurate.
### v1.11.0 (2014-09-05):

@@ -2,0 +14,0 @@

@@ -83,3 +83,9 @@ {

"_from": "bunyan@0.14.6",
"_resolved": "https://registry.npmjs.org/bunyan/-/bunyan-0.14.6.tgz"
"_resolved": "https://registry.npmjs.org/bunyan/-/bunyan-0.14.6.tgz",
"readme": "Bunyan is **a simple and fast a JSON logging library** for node.js services and\n**a `bunyan` CLI tool** for nicely viewing those logs).\n\n![bunyan CLI screenshot](https://raw.github.com/trentm/node-bunyan/master/tools/screenshot1.png)\n\nServer logs should be structured. JSON's a good format. Let's do that: a log\nrecord is one line of `JSON.stringify`'d output. Let's also specify some common\nnames for the requisite and common fields for a log record (see below).\n\nAlso: log4j is way more than you need.\n\n\n# Current Status\n\nSolid core functionality is there. Joyent is using this for a number of\nproduction services. Bunyan supports node 0.6 and greater.\n\nFollow <a href=\"https://twitter.com/intent/user?screen_name=trentmick\" target=\"_blank\">@trentmick</a>\nfor updates to Bunyan.\n\nSee also: [Bunyan for Bash](https://github.com/trevoro/bash-bunyan).\n\n\n# Installation\n\n npm install bunyan\n\n\n# Usage\n\n**The usual.** All loggers must provide a \"name\". This is somewhat akin\nto log4j logger \"name\", but Bunyan doesn't do hierarchical logger names.\n\n $ cat hi.js\n var Logger = require('bunyan');\n var log = new Logger({name: \"myapp\"});\n log.info(\"hi\");\n\nAlternatively, bunyan 0.7.0 and up supports a more node.js-land typical\nstyle (which might become the preferred form over time):\n\n var bunyan = require('bunyan');\n var log = bunyan.createLogger({name: \"myapp\"});\n\n**Log records are JSON.** \"hostname\", \"time\" and \"v\" (the Bunyan log\nformat version) are added for you.\n\n $ node hi.js\n {\"name\":\"myapp\",\"hostname\":\"banana.local\",\"pid\":123,\"level\":2,\"msg\":\"hi\",\"time\":\"2012-01-31T00:07:44.216Z\",\"v\":0}\n\nThe full `log.{trace|debug|...|fatal}(...)` API is:\n\n log.info(); // Returns a boolean: is the \"info\" level enabled?\n\n log.info('hi'); // Log a simple string message.\n log.info('hi %s', bob, anotherVar); // Uses `util.format` for msg formatting.\n\n log.info({foo: 'bar'}, 'hi'); // Adds \"foo\" field to log record.\n\n log.info(err); // Special case to log an `Error` instance, adds \"err\"\n // key with exception details (including the stack) and\n // sets \"msg\" to the exception message.\n log.info(err, 'more on this: %s', more);\n // ... or you can specify the \"msg\".\n\nNote that this implies **you cannot pass any object as the first argument\nto log it**. IOW, `log.info(myobject)` isn't going to work the way you\nexpect. Adding support for this API would necessitate (a) JSON-ifying safely\nthat given object (sometimes hard, and probably slow) and (b) putting all its\nattribs under a top-level 'x' field name or something to avoid field name\ncollisions.\n\n\n## bunyan tool\n\nA `bunyan` tool is provided **for pretty-printing bunyan logs** and, eventually,\nfor filtering (e.g. `| bunyan -c 'level>3'`). This shows the default output\n(which is fluid right now) and indented-JSON output. More output formats will\nbe added, including support for custom formats.\n\n $ node hi.js | ./bin/bunyan # CLI tool to filter/pretty-print JSON logs.\n [2012-01-31T00:08:11.387Z] INFO: myapp on banana.local/123: hi\n\n $ node hi.js | ./bin/bunyan -o json\n {\n \"name\": \"myapp\",\n \"hostname\": \"banana.local\",\n \"pid\": 123,\n \"level\": 2,\n \"msg\": \"hi\",\n \"time\": \"2012-01-31T00:10:00.676Z\",\n \"v\": 0\n }\n\n\n## streams\n\nBy default, log output is to stdout (**stream**) and at the \"info\" level.\nExplicitly that looks like:\n\n var log = new Logger({name: \"myapp\", stream: process.stdout,\n level: \"info\"});\n\nThat is an abbreviated form for a single stream. **You can define multiple\nstreams at different levels**.\n\n var log = new Logger({\n name: \"amon\",\n streams: [\n {\n level: \"info\",\n stream: process.stdout, // log INFO and above to stdout\n },\n {\n level: \"error\",\n path: \"tmp/error.log\" // log ERROR and above to a file\n }\n ]\n });\n\nMore on streams in the \"Streams\" section below.\n\n\n## log.child\n\nA `log.child(...)` is provided to **specialize a logger for a sub-component**.\nThe following will have log records from \"Wuzzle\" instances use exactly the\nsame config as its parent, plus include the \"component\" field.\n\n var log = new Logger(...);\n\n ...\n\n function Wuzzle(options) {\n this.log = options.log;\n this.log.info(\"creating a wuzzle\")\n }\n Wuzzle.prototype.woos = function () {\n this.log.warn(\"This wuzzle is woosey.\")\n }\n\n var wuzzle = new Wuzzle({log: log.child({component: \"wuzzle\"})});\n wuzzle.woos();\n log.info(\"done with the wuzzle\")\n\nThe [node-restify](https://github.com/mcavage/node-restify)\nframework integrates bunyan. One feature of its integration, is that each\nrestify request handler includes a `req.log` logger that is:\n\n log.child({req_id: <unique request id>}, true)\n\nApps using restify can then use `req.log` and have all such log records\ninclude the unique request id (as \"req_id\"). Handy.\n\n\n## serializers\n\nBunyan has a concept of **\"serializers\" to produce a JSON-able object from a\nJavaScript object**, so you can easily do the following:\n\n log.info({req: <request object>}, \"something about handling this request\");\n\nAssociation is by log record field name, \"req\" in this example, so this\nrequires a registered serializer something like this:\n\n function reqSerializer(req) {\n return {\n method: req.method,\n url: req.url,\n headers: req.headers\n }\n }\n var log = new Logger({\n ...\n serializers: {\n req: reqSerializer\n }\n });\n\nOr this:\n\n var log = new Logger({\n ...\n serializers: {req: Logger.stdSerializers.req}\n });\n\nbecause Buyan includes a small set of standard serializers. To use all the\nstandard serializers you can use:\n\n var log = new Logger({\n ...\n serializers: Logger.stdSerializers\n });\n\n*Note: Your own serializers should never throw, otherwise you'll get an\nugly message on stderr from Bunyan (along with the traceback) and the field\nin your log record will be replaced with a short error message.*\n\n## src\n\nThe **source file, line and function of the log call site** can be added to\nlog records by using the `src: true` config option:\n\n var log = new Logger({src: true, ...});\n\nThis adds the call source info with the 'src' field, like this:\n\n {\n \"name\": \"src-example\",\n \"hostname\": \"banana.local\",\n \"pid\": 123,\n \"component\": \"wuzzle\",\n \"level\": 4,\n \"msg\": \"This wuzzle is woosey.\",\n \"time\": \"2012-02-06T04:19:35.605Z\",\n \"src\": {\n \"file\": \"/Users/trentm/tm/node-bunyan/examples/src.js\",\n \"line\": 20,\n \"func\": \"Wuzzle.woos\"\n },\n \"v\": 0\n }\n\n**WARNING: Determining the call source info is slow. Never use this option\nin production.**\n\n\n# Levels\n\nThe log levels in bunyan are as follows. The level descriptions are best\npractice *opinions*.\n\n- \"fatal\" (60): The service/app is going to stop or become unusable now.\n An operator should definitely look into this soon.\n- \"error\" (50): Fatal for a particular request, but the service/app continues\n servicing other requests. An operator should look at this soon(ish).\n- \"warn\" (40): A note on something that should probably be looked at by an\n operator eventually.\n- \"info\" (30): Detail on regular operation.\n- \"debug\" (20): Anything else, i.e. too verbose to be included in \"info\" level.\n- \"trace\" (10): Logging from external libraries used by your app or *very*\n detailed application logging.\n\nSuggestions: Use \"debug\" sparingly. Information that will be useful to debug\nerrors *post mortem* should usually be included in \"info\" messages if it's\ngenerally relevant or else with the corresponding \"error\" event. Don't rely\non spewing mostly irrelevant debug messages all the time and sifting through\nthem when an error occurs.\n\nIntegers are used for the actual level values (10 for \"trace\", ..., 60 for\n\"fatal\") and constants are defined for the (Logger.TRACE ... Logger.DEBUG).\nThe lowercase level names are aliases supported in the API.\n\nHere is the API for changing levels in an existing logger:\n\n log.level() -> INFO // gets current level (lowest level of all streams)\n\n log.level(INFO) // set all streams to level INFO\n log.level(\"info\") // set all streams to level INFO\n\n log.levels() -> [DEBUG, INFO] // get array of levels of all streams\n log.levels(0) -> DEBUG // get level of stream at index 0\n log.levels(\"foo\") // get level of stream with name \"foo\"\n\n log.levels(0, INFO) // set level of stream 0 to INFO\n log.levels(0, \"info\") // can use \"info\" et al aliases\n log.levels(\"foo\", WARN) // set stream named \"foo\" to WARN\n\n\n\n# Log Record Fields\n\nThis section will describe *rules* for the Bunyan log format: field names,\nfield meanings, required fields, etc. However, a Bunyan library doesn't\nstrictly enforce all these rules while records are being emitted. For example,\nBunyan will add a `time` field with the correct format to your log records,\nbut you can specify your own. It is the caller's responsibility to specify\nthe appropriate format.\n\nThe reason for the above leniency is because IMO logging a message should\nnever break your app. This leads to this rule of logging: **a thrown\nexception from `log.info(...)` or equivalent (other than for calling with the\nincorrect signature) is always a bug in Bunyan.**\n\n\nA typical Bunyan log record looks like this:\n\n {\"name\":\"myserver\",\"hostname\":\"banana.local\",\"pid\":123,\"req\":{\"method\":\"GET\",\"url\":\"/path?q=1#anchor\",\"headers\":{\"x-hi\":\"Mom\",\"connection\":\"close\"}},\"level\":3,\"msg\":\"start request\",\"time\":\"2012-02-03T19:02:46.178Z\",\"v\":0}\n\nPretty-printed:\n\n {\n \"name\": \"myserver\",\n \"hostname\": \"banana.local\",\n \"pid\": 123,\n \"req\": {\n \"method\": \"GET\",\n \"url\": \"/path?q=1#anchor\",\n \"headers\": {\n \"x-hi\": \"Mom\",\n \"connection\": \"close\"\n },\n \"remoteAddress\": \"120.0.0.1\",\n \"remotePort\": 51244\n },\n \"level\": 3,\n \"msg\": \"start request\",\n \"time\": \"2012-02-03T19:02:57.534Z\",\n \"v\": 0\n }\n\n\nCore fields:\n\n- `v`: Required. Integer. Added by Bunion. Cannot be overriden.\n This is the Bunyan log format version (`require('bunyan').LOG_VERSION`).\n The log version is a single integer. `0` is until I release a version\n \"1.0.0\" of node-bunyan. Thereafter, starting with `1`, this will be\n incremented if there is any backward incompatible change to the log record\n format. Details will be in \"CHANGES.md\" (the change log).\n- `level`: Required. Integer. Added by Bunion. Cannot be overriden.\n See the \"Levels\" section.\n- `name`: Required. String. Provided at Logger creation.\n You must specify a name for your logger when creating it. Typically this\n is the name of the service/app using Bunyan for logging.\n- `hostname`: Required. String. Provided or determined at Logger creation.\n You can specify your hostname at Logger creation or it will be retrieved\n vi `os.hostname()`.\n- `pid`: Required. Integer. Filled in automatically at Logger creation.\n- `time`: Required. String. Added by Bunion. Can be overriden.\n The date and time of the event in [ISO 8601\n Extended Format](http://en.wikipedia.org/wiki/ISO_8601) format and in UTC,\n as from\n [`Date.toISOString()`](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Date/toISOString).\n- `msg`: Required. String.\n Every `log.debug(...)` et al call must provide a log message.\n- `src`: Optional. Object giving log call source info. This is added\n automatically by Bunyan if the \"src: true\" config option is given to the\n Logger. Never use in production as this is really slow.\n\n\nGo ahead and add more fields, and nest ones are fine (and recommended) as\nwell. This is why we're using JSON. Some suggestions and best practices\nfollow (feedback from actual users welcome).\n\n\nRecommended/Best Practice Fields:\n\n- `err`: Object. A caught JS exception. Log that thing with `log.info(err)`\n to get:\n\n ...\n \"err\": {\n \"message\": \"boom\",\n \"name\": \"TypeError\",\n \"stack\": \"TypeError: boom\\n at Object.<anonymous> ...\"\n },\n \"msg\": \"boom\",\n ...\n\n Or use the `Logger.stdSerializers.err` serializer in your Logger and\n do this `log.error({err: err}, \"oops\")`. See \"examples/err.js\".\n\n- `req_id`: String. A request identifier. Including this field in all logging\n tied to handling a particular request to your server is strongly suggested.\n This allows post analysis of logs to easily collate all related logging\n for a request. This really shines when you have a SOA with multiple services\n and you carry a single request ID from the top API down through all APIs\n (as [node-restify](https://github.com/mcavage/node-restify) facilitates\n with its 'X-Request-Id' header).\n\n- `req`: An HTTP server request. Bunyan provides `Logger.stdSerializers.req`\n to serialize a request with a suggested set of keys. Example:\n\n {\n \"method\": \"GET\",\n \"url\": \"/path?q=1#anchor\",\n \"headers\": {\n \"x-hi\": \"Mom\",\n \"connection\": \"close\"\n },\n \"remoteAddress\": \"120.0.0.1\",\n \"remotePort\": 51244\n }\n\n- `res`: An HTTP server response. Bunyan provides `Logger.stdSerializers.res`\n to serialize a response with a suggested set of keys. Example:\n\n {\n \"statusCode\": 200,\n \"header\": \"HTTP/1.1 200 OK\\r\\nContent-Type: text/plain\\r\\nConnection: keep-alive\\r\\nTransfer-Encoding: chunked\\r\\n\\r\\n\"\n }\n\n\nOther fields to consider:\n\n- `req.username`: Authenticated user (or for a 401, the user attempting to\n auth).\n- Some mechanism to calculate response latency. \"restify\" users will have\n a \"X-Response-Time\" header. A `latency` custom field would be fine.\n- `req.body`: If you know that request bodies are small (common in APIs,\n for example), then logging the request body is good.\n\n\n# Streams\n\nA \"stream\" is Bunyan's name for an output for log messages (the equivalent\nto a log4j Appender). Ultimately Bunyan uses a\n[Writable Stream](http://nodejs.org/docs/latest/api/all.html#writable_Stream)\ninterface, but there are some additional attributes used to create and\nmanage the stream. A Bunyan Logger instance has one or more streams.\nIn general streams are specified with the \"streams\" option:\n\n var Logger = require('bunyan');\n var log = new Logger({\n name: \"foo\",\n streams: [\n {\n stream: process.stderr,\n level: \"debug\"\n },\n ...\n ]\n })\n\nFor convenience, if there is only one stream, it can specified with the\n\"stream\" and \"level\" options (internal converted to a `Logger.streams`):\n\n var log = new Logger({\n name: \"foo\",\n stream: process.stderr,\n level: \"debug\"\n })\n\nIf none are specified, the default is a stream on `process.stdout` at the\n\"info\" level.\n\n`Logger.streams` is an array of stream objects with the following attributes:\n\n- `type`: One of \"stream\", \"file\" or \"raw\". See below. Often this is\n implied from the other arguments.\n- `path`: A file path for a file stream. If `path` is given and `type` is\n not specified, then `type` will be set to \"file\".\n- `stream`: This is the \"Writable Stream\", e.g. a std handle or an open\n file write stream. If `stream` is given and `type` is not specified, then\n `type` will be set to \"stream\".\n- `level`: The level at which logging to this stream is enabled. If not\n specified it defaults to INFO.\n\nSupported stream types are:\n\n- `stream`: A plain ol' node.js [Writable\n Stream](http://nodejs.org/docs/latest/api/all.html#writable_Stream).\n A \"stream\" (the writeable stream) value is required.\n\n- `file`: A \"path\" argument is given. Bunyan will open this file for\n appending. E.g.:\n\n {\n \"path\": \"/var/log/foo.log\",\n \"level\": \"warn\"\n }\n\n Bunyan re-emits error events from the created `WriteStream`. So you can\n do this:\n\n var log = new Logger({name: 'mylog', streams: [{path: LOG_PATH}]});\n log.on('error', function (err, stream) {\n // Handle stream write or create error here.\n });\n\n- `raw`: Similar to a \"stream\" writeable stream, except that the write method\n is given raw log record *Object*s instead of a JSON-stringified string.\n This can be useful for hooking on further processing to all Bunyan logging:\n pushing to an external service, a RingBuffer (see below), etc.\n\n\n## RingBuffer Stream\n\nBunyan comes with a special stream called a RingBuffer which keeps the last N\nrecords in memory and does *not* write the data anywhere else. One common\nstrategy is to log 'info' and higher to a normal log file but log all records\n(including 'trace') to a ringbuffer that you can access via a debugger, or your\nown HTTP interface, or a post-mortem facility like MDB or node-panic.\n\nTo use a RingBuffer:\n\n /* Create a ring buffer that stores the last 100 records. */\n var bunyan = require('bunyan');\n var ringbuffer = new bunyan.RingBuffer({ limit: 100 });\n var log = new bunyan({\n name: 'foo',\n streams: [\n {\n level: 'info',\n stream: process.stdout\n },\n {\n level: 'trace',\n type: 'raw', // use 'raw' to get raw log record objects\n stream: ringbuffer\n }\n ]\n });\n\n log.info('hello world');\n console.log(ringbuffer.records);\n\nThis example emits:\n\n [ { name: 'foo',\n hostname: '912d2b29',\n pid: 50346,\n level: 30,\n msg: 'hello world',\n time: '2012-06-19T21:34:19.906Z',\n v: 0 } ]\n\n\n# Versioning\n\nThe scheme I follow is most succintly described by the bootstrap guys\n[here](https://github.com/twitter/bootstrap#versioning).\n\ntl;dr: All versions are `<major>.<minor>.<patch>` which will be incremented for\nbreaking backward compat and major reworks, new features without breaking\nchange, and bug fixes, respectively.\n\n\n\n# License\n\nMIT.\n\n\n\n# Future\n\nSee \"TODO.md\".\n",
"readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/trentm/node-bunyan/issues"
},
"homepage": "https://github.com/trentm/node-bunyan"
}

@@ -68,3 +68,4 @@ {

"directories": {},
"_resolved": "https://registry.npmjs.org/async-listener/-/async-listener-0.4.7.tgz"
"_resolved": "https://registry.npmjs.org/async-listener/-/async-listener-0.4.7.tgz",
"readme": "ERROR: No README data found!"
}

@@ -72,3 +72,4 @@ {

},
"_resolved": "https://registry.npmjs.org/continuation-local-storage/-/continuation-local-storage-3.1.1.tgz"
"_resolved": "https://registry.npmjs.org/continuation-local-storage/-/continuation-local-storage-3.1.1.tgz",
"readme": "ERROR: No README data found!"
}
{
"name": "newrelic",
"version": "1.11.0",
"version": "1.11.1",
"author": "New Relic Node.js agent team <nodejs@newrelic.com>",

@@ -5,0 +5,0 @@ "licenses": [

@@ -57,26 +57,2 @@ 'use strict';

});
describe("when setting the current segment type", function () {
it("it's set for the rest of the current tick", function () {
tracer.setCurrentSegmentType('TEST1');
expect(tracer.isCurrentSegmentType('TEST1')).equal(true);
});
it("it's not set in the future", function (done) {
tracer.setCurrentSegmentType('TEST2');
process.nextTick(function cb_nextTick() {
expect(tracer.isCurrentSegmentType('TEST2')).equal(false);
done();
});
});
it("doesn't false positive when segment type has changed", function () {
tracer.setCurrentSegmentType('TEST3');
tracer.setCurrentSegmentType('nope');
expect(tracer.isCurrentSegmentType('TEST3')).equal(false);
});
});
});

@@ -215,3 +215,3 @@ 'use strict';

children = web.children || [];
t.equal(children.length, 2, "only one child of web node");
t.equal(children.length, 1, "only one child of web node");

@@ -221,5 +221,7 @@ var find = children[0] || {};

"second segment is MongoDB find");
t.equal((find.children || []).length, 0, "no children of find node");
var update = children[1] || {};
children = find.children || [];
t.equal(children.length, 1, "only one child of find node");
var update = children[0] || {};
t.equal(update.name, 'Datastore/statement/MongoDB/' + DB_COLLECTION + '/update',

@@ -226,0 +228,0 @@ "third segment is MongoDB update");

@@ -24,19 +24,17 @@ 'use strict';

var agent = helper.instrumentMockedAgent();
var mongodb = require('mongodb');
t.test("with a callback", function (t) {
t.plan(21);
var server = new mongodb.Server(params.mongodb_host, params.mongodb_port, {auto_reconnect : true});
var db = new mongodb.Db('integration', server, {safe : true});
var agent = helper.instrumentMockedAgent();
var mongodb = require('mongodb');
var server = new mongodb.Server(params.mongodb_host, params.mongodb_port, {auto_reconnect : true});
var db = new mongodb.Db('integration', server, {safe : true});
self.tearDown(function cb_tearDown() {
db.close(true, function (error) {
if (error) t.fail(error);
this.tearDown(function cb_tearDown() {
db.close(true, function (error) {
if (error) t.fail(error);
});
helper.unloadAgent(agent);
});
});
t.test("with a callback", function (t) {
t.plan(18);
agent.once('transactionFinished', function () {

@@ -51,2 +49,7 @@ t.equals(agent.metrics.getMetric('Datastore/all').callCount, 2,

t.equals(
agent.metrics.getMetric('Datastore/operation/MongoDB/findOne').callCount,
1,
"basic findOne should be recorded"
);
t.equals(
agent.metrics.getMetric('Datastore/statement/MongoDB/' + COLLECTION + '/insert').callCount,

@@ -57,7 +60,18 @@ 1,

t.equals(
agent.metrics.getMetric('Datastore/statement/MongoDB/' + COLLECTION + '/findOne').callCount,
1,
"collection findOne should be recorded"
);
t.equals(
agent.metrics.getMetric('Datastore/statement/MongoDB/' + COLLECTION + '/insert',
'Datastore/statement/MongoDB/' + COLLECTION + '/insert').callCount,
1,
"Scoped MongoDB request should be recorded"
"Scoped MongoDB insert should be recorded"
);
t.equals(
agent.metrics.getMetric('Datastore/statement/MongoDB/' + COLLECTION + '/findOne',
'Datastore/statement/MongoDB/' + COLLECTION + '/insert').callCount,
1,
"Scoped MongoDB findOne should be recorded"
);
});

@@ -125,4 +139,16 @@

t.test("with a Cursor", function (t) {
t.plan(8);
t.plan(12);
var agent = helper.instrumentMockedAgent();
var mongodb = require('mongodb');
var server = new mongodb.Server(params.mongodb_host, params.mongodb_port, {auto_reconnect : true});
var db = new mongodb.Db('integration', server, {safe : true});
this.tearDown(function cb_tearDown() {
db.close(true, function (error) {
if (error) t.fail(error);
});
helper.unloadAgent(agent);
});
agent.once('transactionFinished', function () {

@@ -136,6 +162,11 @@ t.equals(

agent.metrics.getMetric('Datastore/operation/MongoDB/insert').callCount,
2,
1,
"basic insert should be recorded with cursor"
);
t.equals(
agent.metrics.getMetric('Datastore/operation/MongoDB/find').callCount,
2,
"basic find should be recorded with cursor"
);
t.equals(
agent.metrics.getMetric('Datastore/statement/MongoDB/' + COLLECTION_CURSOR + '/insert').callCount,

@@ -146,7 +177,18 @@ 1,

t.equals(
agent.metrics.getMetric('Datastore/statement/MongoDB/' + COLLECTION_CURSOR + '/find').callCount,
2,
"collection find should be recorded from cursor"
);
t.equals(
agent.metrics.getMetric('Datastore/statement/MongoDB/' + COLLECTION_CURSOR + '/insert',
'Datastore/statement/MongoDB/' + COLLECTION_CURSOR + '/insert').callCount,
1,
"scoped MongoDB request should be recorded from cursor"
"scoped MongoDB insert should be recorded from cursor"
);
t.equals(
agent.metrics.getMetric('Datastore/statement/MongoDB/' + COLLECTION_CURSOR + '/find',
'Datastore/statement/MongoDB/' + COLLECTION_CURSOR + '/insert').callCount,
2,
"scoped MongoDB find should be recorded from cursor"
);
var instance = 'Datastore/instance/MongoDB/' + params.mongodb_host + ':' + params.mongodb_port;

@@ -180,8 +222,15 @@ t.equals(

transaction.end();
var cursor2 = collection.find({id : 2});
cursor2.toArray(function cb_toArray(error, results) {
if (error) return t.fail(error);
db.close(function cb_close(error) {
if (error) t.fail(error);
t.equals(results.length, 0, "should be no results");
t.end();
transaction.end();
db.close(function cb_close(error) {
if (error) t.fail(error);
t.end();
});
});

@@ -188,0 +237,0 @@ });

@@ -19,3 +19,3 @@ 'use strict';

var COLLECTION = 'test_1_4_0';
var COLLECTION = 'test_1_3_19_plus';

@@ -106,46 +106,53 @@ // +5 asserts

// +6 asserts
// +7 asserts
function verifyTrace(t, transaction, operation) {
try {
var trace = transaction.getTrace();
t.ok(trace, "trace should exist.");
t.ok(trace.root, "root element should exist.");
t.equals(trace.root.children.length, 1, "should be only one child.");
setImmediate(function cb_setImmediate() {
try {
var trace = transaction.getTrace();
t.ok(trace, "trace should exist.");
t.ok(trace.root, "root element should exist.");
t.equals(trace.root.children.length, 1, "should be only one child.");
var segment = trace.root.children[0];
t.ok(segment, "trace segment for " + operation + " should exist");
t.equals(segment.name, 'Datastore/statement/MongoDB/' + COLLECTION + '/' + operation,
"should register the " + operation);
t.equals(segment.children.length, 0, "should have no children");
}
catch (error) {
t.fail(error);
t.end();
}
var segment = trace.root.children[0];
t.ok(segment, "trace segment for " + operation + " should exist");
t.equals(segment.name, 'Datastore/statement/MongoDB/' + COLLECTION + '/' + operation,
"should register the " + operation);
t.equals(segment.children.length, 0, "should have no children");
t.ok(segment._isEnded(), "should have ended");
}
catch (error) {
t.fail(error);
t.end();
}
});
}
// +9 asserts
// +11 asserts
function verifyTraceNoCallback(t, transaction, operation, verifier) {
try {
var trace = transaction.getTrace();
t.ok(trace, "trace should exist.");
t.ok(trace.root, "root element should exist.");
t.equals(trace.root.children.length, 2, "should be two children.");
setImmediate(function cb_setImmediate() {
try {
var trace = transaction.getTrace();
t.ok(trace, "trace should exist.");
t.ok(trace.root, "root element should exist.");
t.equals(trace.root.children.length, 2, "should be two children.");
var segment = trace.root.children[0];
t.ok(segment, "trace segment for " + operation + " should exist");
t.equals(segment.name, 'Datastore/statement/MongoDB/' + COLLECTION + '/' + operation,
"should register the " + operation);
t.equals(segment.children.length, 0, "should have no children");
var segment = trace.root.children[0];
t.ok(segment, "trace segment for " + operation + " should exist");
t.equals(segment.name, 'Datastore/statement/MongoDB/' + COLLECTION + '/' + operation,
"should register the " + operation);
t.equals(segment.children.length, 0, "should have no children");
t.ok(segment._isEnded(), "should have ended");
segment = trace.root.children[1];
t.ok(segment, "trace segment for " + verifier + " should exist");
t.equals(segment.name, 'Datastore/statement/MongoDB/' + COLLECTION + '/' + verifier,
"should register the " + verifier);
t.equals(segment.children.length, 0, "should have no children");
}
catch (error) {
t.fail(error);
t.end();
}
segment = trace.root.children[1];
t.ok(segment, "trace segment for " + verifier + " should exist");
t.equals(segment.name, 'Datastore/statement/MongoDB/' + COLLECTION + '/' + verifier,
"should register the " + verifier);
t.equals(segment.children.length, 0, "should have no children");
t.ok(segment._isEnded(), "should have ended");
}
catch (error) {
t.fail(error);
t.end();
}
});
}

@@ -236,3 +243,3 @@

t.test("with callback", {timeout : SLUG_FACTOR}, function (t) {
t.plan(13);
t.plan(14);

@@ -257,3 +264,3 @@ runWithTransaction(this, t, function (agent, collection, transaction) {

t.test("with no callback (w = 0)", {timeout : SLUG_FACTOR}, function (t) {
t.plan(11);
t.plan(12);

@@ -316,6 +323,6 @@ runWithTransaction(this, t, function (agent, collection, transaction) {

t.test("inside transaction", function (t) {
t.plan(2);
t.plan(5);
t.test("with callback", {timeout : SLUG_FACTOR}, function (t) {
t.plan(13);
t.test("with selector, with callback, then toArray", {timeout : SLUG_FACTOR}, function (t) {
t.plan(16);

@@ -325,4 +332,31 @@ runWithTransaction(this, t, function (agent, collection, transaction) {

collection.find({id : 1337}, function (error, result) {
collection.find({id : 1337}, function (error, cursor) {
if (error) { t.fail(error); return t.end(); }
t.ok(cursor, "should have gotten back cursor");
t.ok(agent.getTransaction(), "transaction should still be visible");
cursor.toArray(function cb_toArray(error, result) {
if (error) { t.fail(error); return t.end(); }
t.ok(result, "should have gotten back results");
t.ok(agent.getTransaction(), "transaction should still be visible");
transaction.end();
verifyTrace(t, transaction, 'find');
});
});
});
});
t.test("without selector, then toArray", {timeout : SLUG_FACTOR}, function (t) {
t.plan(14);
runWithTransaction(this, t, function (agent, collection, transaction) {
addMetricsVerifier(t, agent, 'find');
var cursor = collection.find();
cursor.toArray(function cb_toArray(error, result) {
if (error) { t.fail(error); return t.end(); }
t.ok(result, "should have gotten back results");

@@ -339,3 +373,3 @@

t.test("with Cursor", {timeout : SLUG_FACTOR}, function (t) {
t.test("with selector, then each", {timeout : SLUG_FACTOR}, function (t) {
t.plan(13);

@@ -346,7 +380,57 @@

var cursor = collection.find({id : 1337});
cursor.toArray(function cb_toArray(error, result) {
var cursor = collection.find();
cursor.each(function cb_each(error, result) {
if (error) { t.fail(error); return t.end(); }
// When result is null we've exhausted all results
if (result !== null) return;
t.ok(agent.getTransaction(), "transaction should still be visible");
transaction.end();
verifyTrace(t, transaction, 'find');
});
});
});
t.test("with selector, then nextObject to exhaustion", {timeout : SLUG_FACTOR}, function (t) {
t.plan(21);
runWithTransaction(this, t, function (agent, collection, transaction) {
addMetricsVerifier(t, agent, 'find');
var cursor = collection.find();
function cb_nextObject(error, result) {
if (error) { t.fail(error); return t.end(); }
t.ok(agent.getTransaction(), "transaction should still be visible");
if (result) {
t.ok(result, "should have gotten back results");
cursor.nextObject(cb_nextObject);
} else {
transaction.end();
verifyTrace(t, transaction, 'find');
}
};
cursor.nextObject(cb_nextObject);
});
});
t.test("with selector, then nextObject, then close", {timeout : SLUG_FACTOR}, function (t) {
t.plan(14);
runWithTransaction(this, t, function (agent, collection, transaction) {
addMetricsVerifier(t, agent, 'find');
var cursor = collection.find();
cursor.nextObject(function cb_nextObject(error, result) {
if (error) { t.fail(error); return t.end(); }
t.ok(result, "should have gotten back results");
cursor.close();
t.ok(agent.getTransaction(), "transaction should still be visible");

@@ -407,3 +491,3 @@

t.test("with callback", {timeout : SLUG_FACTOR}, function (t) {
t.plan(13);
t.plan(14);

@@ -459,3 +543,3 @@ runWithTransaction(this, t, function (agent, collection, transaction) {

t.test("with callback", {timeout : SLUG_FACTOR}, function (t) {
t.plan(14);
t.plan(15);

@@ -521,3 +605,3 @@ runWithTransaction(this, t, function (agent, collection, transaction) {

t.test("with callback", {timeout : SLUG_FACTOR}, function (t) {
t.plan(14);
t.plan(15);

@@ -595,3 +679,3 @@ var current = this;

t.test("with callback", {timeout : SLUG_FACTOR}, function (t) {
t.plan(13);
t.plan(14);

@@ -619,3 +703,3 @@ runWithTransaction(this, t, function (agent, collection, transaction) {

t.test("with no callback (w = 0)", {timeout : SLUG_FACTOR}, function (t) {
t.plan(21);
t.plan(23);

@@ -703,3 +787,3 @@ runWithTransaction(this, t, function (agent, collection, transaction) {

t.test("with callback", {timeout : SLUG_FACTOR}, function (t) {
t.plan(15);
t.plan(16);

@@ -727,3 +811,3 @@ runWithTransaction(this, t, function (agent, collection, transaction) {

t.test("with no callback (w = 0)", {timeout : SLUG_FACTOR}, function (t) {
t.plan(19);
t.plan(21);

@@ -805,3 +889,3 @@ runWithTransaction(this, t, function (agent, collection, transaction) {

t.test("with callback", {timeout : SLUG_FACTOR}, function (t) {
t.plan(13);
t.plan(14);

@@ -857,3 +941,3 @@ runWithTransaction(this, t, function (agent, collection, transaction) {

t.test("with callback", {timeout : SLUG_FACTOR}, function (t) {
t.plan(13);
t.plan(14);

@@ -909,3 +993,3 @@ runWithTransaction(this, t, function (agent, collection, transaction) {

t.test("with callback", {timeout : SLUG_FACTOR}, function (t) {
t.plan(13);
t.plan(14);

@@ -961,3 +1045,3 @@ runWithTransaction(this, t, function (agent, collection, transaction) {

t.test("with callback", {timeout : SLUG_FACTOR}, function (t) {
t.plan(13);
t.plan(14);

@@ -1013,3 +1097,3 @@ runWithTransaction(this, t, function (agent, collection, transaction) {

t.test("with callback", {timeout : SLUG_FACTOR}, function (t) {
t.plan(13);
t.plan(14);

@@ -1065,3 +1149,3 @@ runWithTransaction(this, t, function (agent, collection, transaction) {

t.test("with callback", {timeout : SLUG_FACTOR}, function (t) {
t.plan(13);
t.plan(14);

@@ -1117,3 +1201,3 @@ runWithTransaction(this, t, function (agent, collection, transaction) {

t.test("with callback", {timeout : SLUG_FACTOR}, function (t) {
t.plan(13);
t.plan(14);

@@ -1170,3 +1254,3 @@ runWithTransaction(this, t, function (agent, collection, transaction) {

t.test("with callback", {timeout : 5000}, function (t) {
t.plan(13);
t.plan(14);

@@ -1191,3 +1275,3 @@ runWithTransaction(this, t, function (agent, collection, transaction) {

t.test("with no callback (w = 0)", {timeout : SLUG_FACTOR}, function (t) {
t.plan(18);
t.plan(20);

@@ -1194,0 +1278,0 @@ runWithTransaction(this, t, function (agent, collection, transaction) {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc