{"action":"closed","issue":{"url":"https://api.github.com/repos/Automattic/mongoose/issues/6376","repository_url":"https://api.github.com/repos/Automattic/mongoose","labels_url":"https://api.github.com/repos/Automattic/mongoose/issues/6376/labels{/name}","comments_url":"https://api.github.com/repos/Automattic/mongoose/issues/6376/comments","events_url":"https://api.github.com/repos/Automattic/mongoose/issues/6376/events","html_url":"https://github.com/Automattic/mongoose/issues/6376","id":316438439,"number":6376,"title":"Query times in mongoose","user":{"login":"suchitagarwal","id":773077,"avatar_url":"https://avatars0.githubusercontent.com/u/773077?v=4","gravatar_id":"","url":"https://api.github.com/users/suchitagarwal","html_url":"https://github.com/suchitagarwal","followers_url":"https://api.github.com/users/suchitagarwal/followers","following_url":"https://api.github.com/users/suchitagarwal/following{/other_user}","gists_url":"https://api.github.com/users/suchitagarwal/gists{/gist_id}","starred_url":"https://api.github.com/users/suchitagarwal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/suchitagarwal/subscriptions","organizations_url":"https://api.github.com/users/suchitagarwal/orgs","repos_url":"https://api.github.com/users/suchitagarwal/repos","events_url":"https://api.github.com/users/suchitagarwal/events{/privacy}","received_events_url":"https://api.github.com/users/suchitagarwal/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-04-20T23:22:57Z","updated_at":"2018-04-25T14:34:06Z","closed_at":"2018-04-25T14:34:06Z","author_association":"NONE","body":"**Do you want to request a *feature* or report a *bug*?**\r\nfeature\r\n\r\n**What is the current behavior?**\r\nN/A\r\n\r\n**If the current behavior is a bug, please provide the steps to reproduce.**\r\nN/A\r\n\r\n**What is the expected behavior?**\r\nA way to log the time taken by each mongoose query\r\n\r\nContext:\r\nWe recently had an issue where our mongo instances were thrashing because we were running a really large and slow query. The size of the query itself was about 5MB and it was taking minutes to execute. I would like to look at each query that we send to mongo and log something if the time taken by the query is above a threshold. The `mongoose.('debug', () => {});` only allows to log the query before it's sent, but no way to find the time taken by the query\r\n\r\n**Please mention your node.js, mongoose and MongoDB version.**\r\nnode: v8.9.1\r\nmongoose: 4.11.11\r\nmongo: 3.4\r\n"}}
{"actor":{"display_login":"vkarpov15"}}