{"action":"created","comment":{"url":"https://api.github.com/repos/Runnable/ponos/pulls/comments/50279227","id":50279227,"diff_hunk":"@@ -111,6 +112,51 @@ Worker.prototype._reportError = function (err) {\n }\n \n /**\n+ * Helper function for creating monitor-dog events tags\n+ * `queue` is the only mandatory tag.\n+ * Few tags would be created depednding on the queue name\n+ * If queueName use `.` as delimiter e.x. `10.0.0.20.api.github.push` then\n+ * following tags would be created:\n+ * - token0: 'push'\n+ * - token1: 'github.push'\n+ * - token2: 'api.github.push'\n+ * - token3: '10.0.0.20.api.github.push'\n+ * @private\n+ * @returns {Object} tags as Object {queue: 'docker.event.publish'}\n+ */\n+Worker.prototype._eventTags = function () {\n+  var tokens = this.queue.split('.').reverse()\n+  var lastToken = ''\n+  var tags = tokens.reduce(function (acc, currentValue, currentIndex) {\n+    var key = 'token' + currentIndex\n+    var newToken = (currentIndex === 0 ? currentValue : currentValue + '.' + lastToken)\n+    acc[key] = newToken\n+    lastToken = newToken\n+    return acc\n+  }, {})\n+  tags.queue = this.queue\n+  return tags\n+}\n+\n+/**\n+ * Helper function calling `monitor.increment`.\n+ * Monitor wouldn't be called if `process.env.WORKER_MONITOR_DISABLED` set.\n+ * @param {string} eventName name to be reported into the datadog\n+ * @param {object} [extraTags] extra tags to be send with the event\n+ * @private\n+ */\n+Worker.prototype._inc = function (eventName, extraTags) {","path":"lib/worker.js","position":45,"original_position":45,"commit_id":"c63c978a3dce1cefb17e347db6539610ddfde429","original_commit_id":"c63c978a3dce1cefb17e347db6539610ddfde429","user":{"login":"bkendall","id":160236,"avatar_url":"https://avatars.githubusercontent.com/u/160236?v=3","gravatar_id":"","url":"https://api.github.com/users/bkendall","html_url":"https://github.com/bkendall","followers_url":"https://api.github.com/users/bkendall/followers","following_url":"https://api.github.com/users/bkendall/following{/other_user}","gists_url":"https://api.github.com/users/bkendall/gists{/gist_id}","starred_url":"https://api.github.com/users/bkendall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bkendall/subscriptions","organizations_url":"https://api.github.com/users/bkendall/orgs","repos_url":"https://api.github.com/users/bkendall/repos","events_url":"https://api.github.com/users/bkendall/events{/privacy}","received_events_url":"https://api.github.com/users/bkendall/received_events","type":"User","site_admin":false},"body":"Can we rename this function? `_inc` is maddeningly unhelpful when I was reading it below. `_incMonitor`, maybe?","created_at":"2016-01-20T16:35:35Z","updated_at":"2016-01-20T16:35:35Z","html_url":"https://github.com/Runnable/ponos/pull/25#discussion_r50279227","pull_request_url":"https://api.github.com/repos/Runnable/ponos/pulls/25","_links":{"self":{"href":"https://api.github.com/repos/Runnable/ponos/pulls/comments/50279227"},"html":{"href":"https://github.com/Runnable/ponos/pull/25#discussion_r50279227"},"pull_request":{"href":"https://api.github.com/repos/Runnable/ponos/pulls/25"}}},"pull_request":{"url":"https://api.github.com/repos/Runnable/ponos/pulls/25","id":56241268,"html_url":"https://github.com/Runnable/ponos/pull/25","diff_url":"https://github.com/Runnable/ponos/pull/25.diff","patch_url":"https://github.com/Runnable/ponos/pull/25.patch","issue_url":"https://api.github.com/repos/Runnable/ponos/issues/25","number":25,"state":"open","locked":false,"title":"Add monitor-dog","user":{"login":"podviaznikov","id":429706,"avatar_url":"https://avatars.githubusercontent.com/u/429706?v=3","gravatar_id":"","url":"https://api.github.com/users/podviaznikov","html_url":"https://github.com/podviaznikov","followers_url":"https://api.github.com/users/podviaznikov/followers","following_url":"https://api.github.com/users/podviaznikov/following{/other_user}","gists_url":"https://api.github.com/users/podviaznikov/gists{/gist_id}","starred_url":"https://api.github.com/users/podviaznikov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/podviaznikov/subscriptions","organizations_url":"https://api.github.com/users/podviaznikov/orgs","repos_url":"https://api.github.com/users/podviaznikov/repos","events_url":"https://api.github.com/users/podviaznikov/events{/privacy}","received_events_url":"https://api.github.com/users/podviaznikov/received_events","type":"User","site_admin":false},"body":"Add counter and timer for all ponos jobs. Hidden behind flag.\r\n- increment for all started jobs\r\n- increment for all jobs results: success, timeout error, fatal error, task error\r\n- ponos.timer to track how long each task execution took\r\n\r\n- [x] please merge https://github.com/Runnable/monitor-dog/pull/11 first\r\n- [x] use merged version of monitor-dog\r\n- [x] review\r\n- [ ] demo","created_at":"2016-01-16T01:24:57Z","updated_at":"2016-01-20T16:35:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"381311866e44a255ef5fe0d778c237cc123fbf20","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Runnable/ponos/pulls/25/commits","review_comments_url":"https://api.github.com/repos/Runnable/ponos/pulls/25/comments","review_comment_url":"https://api.github.com/repos/Runnable/ponos/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Runnable/ponos/issues/25/comments","statuses_url":"https://api.github.com/repos/Runnable/ponos/statuses/c63c978a3dce1cefb17e347db6539610ddfde429","head":{"label":"Runnable:monitordog","ref":"monitordog","sha":"c63c978a3dce1cefb17e347db6539610ddfde429","user":{"login":"Runnable","id":2828361,"avatar_url":"https://avatars.githubusercontent.com/u/2828361?v=3","gravatar_id":"","url":"https://api.github.com/users/Runnable","html_url":"https://github.com/Runnable","followers_url":"https://api.github.com/users/Runnable/followers","following_url":"https://api.github.com/users/Runnable/following{/other_user}","gists_url":"https://api.github.com/users/Runnable/gists{/gist_id}","starred_url":"https://api.github.com/users/Runnable/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Runnable/subscriptions","organizations_url":"https://api.github.com/users/Runnable/orgs","repos_url":"https://api.github.com/users/Runnable/repos","events_url":"https://api.github.com/users/Runnable/events{/privacy}","received_events_url":"https://api.github.com/users/Runnable/received_events","type":"Organization","site_admin":false},"repo":{"id":41134020,"name":"ponos","full_name":"Runnable/ponos","owner":{"login":"Runnable","id":2828361,"avatar_url":"https://avatars.githubusercontent.com/u/2828361?v=3","gravatar_id":"","url":"https://api.github.com/users/Runnable","html_url":"https://github.com/Runnable","followers_url":"https://api.github.com/users/Runnable/followers","following_url":"https://api.github.com/users/Runnable/following{/other_user}","gists_url":"https://api.github.com/users/Runnable/gists{/gist_id}","starred_url":"https://api.github.com/users/Runnable/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Runnable/subscriptions","organizations_url":"https://api.github.com/users/Runnable/orgs","repos_url":"https://api.github.com/users/Runnable/repos","events_url":"https://api.github.com/users/Runnable/events{/privacy}","received_events_url":"https://api.github.com/users/Runnable/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Runnable/ponos","description":"An opinionated queue based worker server for node.","fork":false,"url":"https://api.github.com/repos/Runnable/ponos","forks_url":"https://api.github.com/repos/Runnable/ponos/forks","keys_url":"https://api.github.com/repos/Runnable/ponos/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Runnable/ponos/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Runnable/ponos/teams","hooks_url":"https://api.github.com/repos/Runnable/ponos/hooks","issue_events_url":"https://api.github.com/repos/Runnable/ponos/issues/events{/number}","events_url":"https://api.github.com/repos/Runnable/ponos/events","assignees_url":"https://api.github.com/repos/Runnable/ponos/assignees{/user}","branches_url":"https://api.github.com/repos/Runnable/ponos/branches{/branch}","tags_url":"https://api.github.com/repos/Runnable/ponos/tags","blobs_url":"https://api.github.com/repos/Runnable/ponos/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Runnable/ponos/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Runnable/ponos/git/refs{/sha}","trees_url":"https://api.github.com/repos/Runnable/ponos/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Runnable/ponos/statuses/{sha}","languages_url":"https://api.github.com/repos/Runnable/ponos/languages","stargazers_url":"https://api.github.com/repos/Runnable/ponos/stargazers","contributors_url":"https://api.github.com/repos/Runnable/ponos/contributors","subscribers_url":"https://api.github.com/repos/Runnable/ponos/subscribers","subscription_url":"https://api.github.com/repos/Runnable/ponos/subscription","commits_url":"https://api.github.com/repos/Runnable/ponos/commits{/sha}","git_commits_url":"https://api.github.com/repos/Runnable/ponos/git/commits{/sha}","comments_url":"https://api.github.com/repos/Runnable/ponos/comments{/number}","issue_comment_url":"https://api.github.com/repos/Runnable/ponos/issues/comments{/number}","contents_url":"https://api.github.com/repos/Runnable/ponos/contents/{+path}","compare_url":"https://api.github.com/repos/Runnable/ponos/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Runnable/ponos/merges","archive_url":"https://api.github.com/repos/Runnable/ponos/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Runnable/ponos/downloads","issues_url":"https://api.github.com/repos/Runnable/ponos/issues{/number}","pulls_url":"https://api.github.com/repos/Runnable/ponos/pulls{/number}","milestones_url":"https://api.github.com/repos/Runnable/ponos/milestones{/number}","notifications_url":"https://api.github.com/repos/Runnable/ponos/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Runnable/ponos/labels{/name}","releases_url":"https://api.github.com/repos/Runnable/ponos/releases{/id}","created_at":"2015-08-21T04:08:01Z","updated_at":"2016-01-11T21:07:51Z","pushed_at":"2016-01-20T02:11:22Z","git_url":"git://github.com/Runnable/ponos.git","ssh_url":"git@github.com:Runnable/ponos.git","clone_url":"https://github.com/Runnable/ponos.git","svn_url":"https://github.com/Runnable/ponos","homepage":null,"size":536,"stargazers_count":3,"watchers_count":3,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":3,"default_branch":"master"}},"base":{"label":"Runnable:master","ref":"master","sha":"f605833ea6c05736980180b04726332e19bf5efc","user":{"login":"Runnable","id":2828361,"avatar_url":"https://avatars.githubusercontent.com/u/2828361?v=3","gravatar_id":"","url":"https://api.github.com/users/Runnable","html_url":"https://github.com/Runnable","followers_url":"https://api.github.com/users/Runnable/followers","following_url":"https://api.github.com/users/Runnable/following{/other_user}","gists_url":"https://api.github.com/users/Runnable/gists{/gist_id}","starred_url":"https://api.github.com/users/Runnable/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Runnable/subscriptions","organizations_url":"https://api.github.com/users/Runnable/orgs","repos_url":"https://api.github.com/users/Runnable/repos","events_url":"https://api.github.com/users/Runnable/events{/privacy}","received_events_url":"https://api.github.com/users/Runnable/received_events","type":"Organization","site_admin":false},"repo":{"id":41134020,"name":"ponos","full_name":"Runnable/ponos","owner":{"login":"Runnable","id":2828361,"avatar_url":"https://avatars.githubusercontent.com/u/2828361?v=3","gravatar_id":"","url":"https://api.github.com/users/Runnable","html_url":"https://github.com/Runnable","followers_url":"https://api.github.com/users/Runnable/followers","following_url":"https://api.github.com/users/Runnable/following{/other_user}","gists_url":"https://api.github.com/users/Runnable/gists{/gist_id}","starred_url":"https://api.github.com/users/Runnable/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Runnable/subscriptions","organizations_url":"https://api.github.com/users/Runnable/orgs","repos_url":"https://api.github.com/users/Runnable/repos","events_url":"https://api.github.com/users/Runnable/events{/privacy}","received_events_url":"https://api.github.com/users/Runnable/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Runnable/ponos","description":"An opinionated queue based worker server for node.","fork":false,"url":"https://api.github.com/repos/Runnable/ponos","forks_url":"https://api.github.com/repos/Runnable/ponos/forks","keys_url":"https://api.github.com/repos/Runnable/ponos/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Runnable/ponos/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Runnable/ponos/teams","hooks_url":"https://api.github.com/repos/Runnable/ponos/hooks","issue_events_url":"https://api.github.com/repos/Runnable/ponos/issues/events{/number}","events_url":"https://api.github.com/repos/Runnable/ponos/events","assignees_url":"https://api.github.com/repos/Runnable/ponos/assignees{/user}","branches_url":"https://api.github.com/repos/Runnable/ponos/branches{/branch}","tags_url":"https://api.github.com/repos/Runnable/ponos/tags","blobs_url":"https://api.github.com/repos/Runnable/ponos/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Runnable/ponos/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Runnable/ponos/git/refs{/sha}","trees_url":"https://api.github.com/repos/Runnable/ponos/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Runnable/ponos/statuses/{sha}","languages_url":"https://api.github.com/repos/Runnable/ponos/languages","stargazers_url":"https://api.github.com/repos/Runnable/ponos/stargazers","contributors_url":"https://api.github.com/repos/Runnable/ponos/contributors","subscribers_url":"https://api.github.com/repos/Runnable/ponos/subscribers","subscription_url":"https://api.github.com/repos/Runnable/ponos/subscription","commits_url":"https://api.github.com/repos/Runnable/ponos/commits{/sha}","git_commits_url":"https://api.github.com/repos/Runnable/ponos/git/commits{/sha}","comments_url":"https://api.github.com/repos/Runnable/ponos/comments{/number}","issue_comment_url":"https://api.github.com/repos/Runnable/ponos/issues/comments{/number}","contents_url":"https://api.github.com/repos/Runnable/ponos/contents/{+path}","compare_url":"https://api.github.com/repos/Runnable/ponos/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Runnable/ponos/merges","archive_url":"https://api.github.com/repos/Runnable/ponos/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Runnable/ponos/downloads","issues_url":"https://api.github.com/repos/Runnable/ponos/issues{/number}","pulls_url":"https://api.github.com/repos/Runnable/ponos/pulls{/number}","milestones_url":"https://api.github.com/repos/Runnable/ponos/milestones{/number}","notifications_url":"https://api.github.com/repos/Runnable/ponos/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Runnable/ponos/labels{/name}","releases_url":"https://api.github.com/repos/Runnable/ponos/releases{/id}","created_at":"2015-08-21T04:08:01Z","updated_at":"2016-01-11T21:07:51Z","pushed_at":"2016-01-20T02:11:22Z","git_url":"git://github.com/Runnable/ponos.git","ssh_url":"git@github.com:Runnable/ponos.git","clone_url":"https://github.com/Runnable/ponos.git","svn_url":"https://github.com/Runnable/ponos","homepage":null,"size":536,"stargazers_count":3,"watchers_count":3,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Runnable/ponos/pulls/25"},"html":{"href":"https://github.com/Runnable/ponos/pull/25"},"issue":{"href":"https://api.github.com/repos/Runnable/ponos/issues/25"},"comments":{"href":"https://api.github.com/repos/Runnable/ponos/issues/25/comments"},"review_comments":{"href":"https://api.github.com/repos/Runnable/ponos/pulls/25/comments"},"review_comment":{"href":"https://api.github.com/repos/Runnable/ponos/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Runnable/ponos/pulls/25/commits"},"statuses":{"href":"https://api.github.com/repos/Runnable/ponos/statuses/c63c978a3dce1cefb17e347db6539610ddfde429"}}}}