You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
subj. It can be really helpful while catching slow queries.
this.db.on("endQuery", function (obj, q) {
if (obj.err)
console.error(obj.err);
var queryPerformance = obj && obj.perf && obj.perf.query ? obj.perf.query : -1;
if (queryPerformance > 500)
console.log('slow query performance:' + queryPerformance + ' on connection ' + options.connectionID);
//It would be nice to see, what query did its job slow
});
in db.js:
if (this.listeners('endQuery').length > 0) {
var err, e, s = Date.now();
promise
.bind(this)
.catch(function (_err) {
err = _err;
})
.tap(function (res) {
e = Date.now();
this.emit("endQuery", {
err: err,
result: res,
perf: {
query: e - s
},
data: data
});
});
}
The text was updated successfully, but these errors were encountered:
Would be great to get informations from serialization, network and query execution on the db. Measure time at the highest level is just an estimated value.
subj. It can be really helpful while catching slow queries.
in db.js:
The text was updated successfully, but these errors were encountered: