{"action":"created","comment":{"url":"https://api.github.com/repos/esl/MongooseIM/pulls/comments/57156333","id":57156333,"diff_hunk":"@@ -276,9 +276,16 @@ create_metrics(Host) ->\n     lists:foreach(fun(Name) -> ensure_metric(Name, counter) end,\n                   get_total_counters(Host)).\n \n-ensure_metric(Metric, Type) when is_list(Metric) ->\n+ensure_metric(Metric, Type) when is_tuple(Type) ->","path":"apps/ejabberd/src/mongoose_metrics.erl","position":5,"original_position":5,"commit_id":"dfd0968d9e20f6320321b2eb3ffe7680c4b3eb6f","original_commit_id":"dfd0968d9e20f6320321b2eb3ffe7680c4b3eb6f","user":{"login":"michalwski","id":705828,"avatar_url":"https://avatars.githubusercontent.com/u/705828?v=3","gravatar_id":"","url":"https://api.github.com/users/michalwski","html_url":"https://github.com/michalwski","followers_url":"https://api.github.com/users/michalwski/followers","following_url":"https://api.github.com/users/michalwski/following{/other_user}","gists_url":"https://api.github.com/users/michalwski/gists{/gist_id}","starred_url":"https://api.github.com/users/michalwski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michalwski/subscriptions","organizations_url":"https://api.github.com/users/michalwski/orgs","repos_url":"https://api.github.com/users/michalwski/repos","events_url":"https://api.github.com/users/michalwski/events{/privacy}","received_events_url":"https://api.github.com/users/michalwski/received_events","type":"User","site_admin":false},"body":"Is this `Type` tuple well defined? I mean, do we know if it's always of form `{Type, Sth}`. If so then, I think it would be better to place this check as pattern matching in function's head.\r\n\r\n```erlang\r\nensure_metric(Metric, {El1, _El2} = Type) ->\r\n    ensure_metric(Metric, Type, El1);\r\n```\r\n\r\nOf course `El1` should have more meaningful name. ","created_at":"2016-03-23T13:15:11Z","updated_at":"2016-03-23T13:15:11Z","html_url":"https://github.com/esl/MongooseIM/pull/707#discussion_r57156333","pull_request_url":"https://api.github.com/repos/esl/MongooseIM/pulls/707","_links":{"self":{"href":"https://api.github.com/repos/esl/MongooseIM/pulls/comments/57156333"},"html":{"href":"https://github.com/esl/MongooseIM/pull/707#discussion_r57156333"},"pull_request":{"href":"https://api.github.com/repos/esl/MongooseIM/pulls/707"}}},"pull_request":{"url":"https://api.github.com/repos/esl/MongooseIM/pulls/707","id":63044724,"html_url":"https://github.com/esl/MongooseIM/pull/707","diff_url":"https://github.com/esl/MongooseIM/pull/707.diff","patch_url":"https://github.com/esl/MongooseIM/pull/707.patch","issue_url":"https://api.github.com/repos/esl/MongooseIM/issues/707","number":707,"state":"open","locked":false,"title":"upped exometer to 1.2","user":{"login":"bartekgorny","id":70064,"avatar_url":"https://avatars.githubusercontent.com/u/70064?v=3","gravatar_id":"","url":"https://api.github.com/users/bartekgorny","html_url":"https://github.com/bartekgorny","followers_url":"https://api.github.com/users/bartekgorny/followers","following_url":"https://api.github.com/users/bartekgorny/following{/other_user}","gists_url":"https://api.github.com/users/bartekgorny/gists{/gist_id}","starred_url":"https://api.github.com/users/bartekgorny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bartekgorny/subscriptions","organizations_url":"https://api.github.com/users/bartekgorny/orgs","repos_url":"https://api.github.com/users/bartekgorny/repos","events_url":"https://api.github.com/users/bartekgorny/events{/privacy}","received_events_url":"https://api.github.com/users/bartekgorny/received_events","type":"User","site_admin":false},"body":"Change to a newer version of exometer. No real change.\r\n\r\n\r\n","created_at":"2016-03-16T10:47:10Z","updated_at":"2016-03-23T13:15:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"62cc83dc4c84abce8f5a80acc76dc13f4b3cbbd2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/esl/MongooseIM/pulls/707/commits","review_comments_url":"https://api.github.com/repos/esl/MongooseIM/pulls/707/comments","review_comment_url":"https://api.github.com/repos/esl/MongooseIM/pulls/comments{/number}","comments_url":"https://api.github.com/repos/esl/MongooseIM/issues/707/comments","statuses_url":"https://api.github.com/repos/esl/MongooseIM/statuses/dfd0968d9e20f6320321b2eb3ffe7680c4b3eb6f","head":{"label":"bartekgorny:exometer_1.2","ref":"exometer_1.2","sha":"dfd0968d9e20f6320321b2eb3ffe7680c4b3eb6f","user":{"login":"bartekgorny","id":70064,"avatar_url":"https://avatars.githubusercontent.com/u/70064?v=3","gravatar_id":"","url":"https://api.github.com/users/bartekgorny","html_url":"https://github.com/bartekgorny","followers_url":"https://api.github.com/users/bartekgorny/followers","following_url":"https://api.github.com/users/bartekgorny/following{/other_user}","gists_url":"https://api.github.com/users/bartekgorny/gists{/gist_id}","starred_url":"https://api.github.com/users/bartekgorny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bartekgorny/subscriptions","organizations_url":"https://api.github.com/users/bartekgorny/orgs","repos_url":"https://api.github.com/users/bartekgorny/repos","events_url":"https://api.github.com/users/bartekgorny/events{/privacy}","received_events_url":"https://api.github.com/users/bartekgorny/received_events","type":"User","site_admin":false},"repo":{"id":47578970,"name":"MongooseIM","full_name":"bartekgorny/MongooseIM","owner":{"login":"bartekgorny","id":70064,"avatar_url":"https://avatars.githubusercontent.com/u/70064?v=3","gravatar_id":"","url":"https://api.github.com/users/bartekgorny","html_url":"https://github.com/bartekgorny","followers_url":"https://api.github.com/users/bartekgorny/followers","following_url":"https://api.github.com/users/bartekgorny/following{/other_user}","gists_url":"https://api.github.com/users/bartekgorny/gists{/gist_id}","starred_url":"https://api.github.com/users/bartekgorny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bartekgorny/subscriptions","organizations_url":"https://api.github.com/users/bartekgorny/orgs","repos_url":"https://api.github.com/users/bartekgorny/repos","events_url":"https://api.github.com/users/bartekgorny/events{/privacy}","received_events_url":"https://api.github.com/users/bartekgorny/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bartekgorny/MongooseIM","description":"Jabber / XMPP server with focus on performance and scalability, by Erlang Solutions","fork":true,"url":"https://api.github.com/repos/bartekgorny/MongooseIM","forks_url":"https://api.github.com/repos/bartekgorny/MongooseIM/forks","keys_url":"https://api.github.com/repos/bartekgorny/MongooseIM/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bartekgorny/MongooseIM/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bartekgorny/MongooseIM/teams","hooks_url":"https://api.github.com/repos/bartekgorny/MongooseIM/hooks","issue_events_url":"https://api.github.com/repos/bartekgorny/MongooseIM/issues/events{/number}","events_url":"https://api.github.com/repos/bartekgorny/MongooseIM/events","assignees_url":"https://api.github.com/repos/bartekgorny/MongooseIM/assignees{/user}","branches_url":"https://api.github.com/repos/bartekgorny/MongooseIM/branches{/branch}","tags_url":"https://api.github.com/repos/bartekgorny/MongooseIM/tags","blobs_url":"https://api.github.com/repos/bartekgorny/MongooseIM/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bartekgorny/MongooseIM/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bartekgorny/MongooseIM/git/refs{/sha}","trees_url":"https://api.github.com/repos/bartekgorny/MongooseIM/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bartekgorny/MongooseIM/statuses/{sha}","languages_url":"https://api.github.com/repos/bartekgorny/MongooseIM/languages","stargazers_url":"https://api.github.com/repos/bartekgorny/MongooseIM/stargazers","contributors_url":"https://api.github.com/repos/bartekgorny/MongooseIM/contributors","subscribers_url":"https://api.github.com/repos/bartekgorny/MongooseIM/subscribers","subscription_url":"https://api.github.com/repos/bartekgorny/MongooseIM/subscription","commits_url":"https://api.github.com/repos/bartekgorny/MongooseIM/commits{/sha}","git_commits_url":"https://api.github.com/repos/bartekgorny/MongooseIM/git/commits{/sha}","comments_url":"https://api.github.com/repos/bartekgorny/MongooseIM/comments{/number}","issue_comment_url":"https://api.github.com/repos/bartekgorny/MongooseIM/issues/comments{/number}","contents_url":"https://api.github.com/repos/bartekgorny/MongooseIM/contents/{+path}","compare_url":"https://api.github.com/repos/bartekgorny/MongooseIM/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bartekgorny/MongooseIM/merges","archive_url":"https://api.github.com/repos/bartekgorny/MongooseIM/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bartekgorny/MongooseIM/downloads","issues_url":"https://api.github.com/repos/bartekgorny/MongooseIM/issues{/number}","pulls_url":"https://api.github.com/repos/bartekgorny/MongooseIM/pulls{/number}","milestones_url":"https://api.github.com/repos/bartekgorny/MongooseIM/milestones{/number}","notifications_url":"https://api.github.com/repos/bartekgorny/MongooseIM/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bartekgorny/MongooseIM/labels{/name}","releases_url":"https://api.github.com/repos/bartekgorny/MongooseIM/releases{/id}","deployments_url":"https://api.github.com/repos/bartekgorny/MongooseIM/deployments","created_at":"2015-12-07T21:01:48Z","updated_at":"2016-02-22T13:16:47Z","pushed_at":"2016-03-23T12:59:28Z","git_url":"git://github.com/bartekgorny/MongooseIM.git","ssh_url":"git@github.com:bartekgorny/MongooseIM.git","clone_url":"https://github.com/bartekgorny/MongooseIM.git","svn_url":"https://github.com/bartekgorny/MongooseIM","homepage":"https://www.erlang-solutions.com/products/mongooseim.html","size":15815,"stargazers_count":0,"watchers_count":0,"language":"Erlang","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"esl:master","ref":"master","sha":"8112a1db3792f96e891f69120f946bb5cabe72ee","user":{"login":"esl","id":283412,"avatar_url":"https://avatars.githubusercontent.com/u/283412?v=3","gravatar_id":"","url":"https://api.github.com/users/esl","html_url":"https://github.com/esl","followers_url":"https://api.github.com/users/esl/followers","following_url":"https://api.github.com/users/esl/following{/other_user}","gists_url":"https://api.github.com/users/esl/gists{/gist_id}","starred_url":"https://api.github.com/users/esl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/esl/subscriptions","organizations_url":"https://api.github.com/users/esl/orgs","repos_url":"https://api.github.com/users/esl/repos","events_url":"https://api.github.com/users/esl/events{/privacy}","received_events_url":"https://api.github.com/users/esl/received_events","type":"Organization","site_admin":false},"repo":{"id":2354240,"name":"MongooseIM","full_name":"esl/MongooseIM","owner":{"login":"esl","id":283412,"avatar_url":"https://avatars.githubusercontent.com/u/283412?v=3","gravatar_id":"","url":"https://api.github.com/users/esl","html_url":"https://github.com/esl","followers_url":"https://api.github.com/users/esl/followers","following_url":"https://api.github.com/users/esl/following{/other_user}","gists_url":"https://api.github.com/users/esl/gists{/gist_id}","starred_url":"https://api.github.com/users/esl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/esl/subscriptions","organizations_url":"https://api.github.com/users/esl/orgs","repos_url":"https://api.github.com/users/esl/repos","events_url":"https://api.github.com/users/esl/events{/privacy}","received_events_url":"https://api.github.com/users/esl/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/esl/MongooseIM","description":"Jabber / XMPP server with focus on performance and scalability, by Erlang Solutions","fork":false,"url":"https://api.github.com/repos/esl/MongooseIM","forks_url":"https://api.github.com/repos/esl/MongooseIM/forks","keys_url":"https://api.github.com/repos/esl/MongooseIM/keys{/key_id}","collaborators_url":"https://api.github.com/repos/esl/MongooseIM/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/esl/MongooseIM/teams","hooks_url":"https://api.github.com/repos/esl/MongooseIM/hooks","issue_events_url":"https://api.github.com/repos/esl/MongooseIM/issues/events{/number}","events_url":"https://api.github.com/repos/esl/MongooseIM/events","assignees_url":"https://api.github.com/repos/esl/MongooseIM/assignees{/user}","branches_url":"https://api.github.com/repos/esl/MongooseIM/branches{/branch}","tags_url":"https://api.github.com/repos/esl/MongooseIM/tags","blobs_url":"https://api.github.com/repos/esl/MongooseIM/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/esl/MongooseIM/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/esl/MongooseIM/git/refs{/sha}","trees_url":"https://api.github.com/repos/esl/MongooseIM/git/trees{/sha}","statuses_url":"https://api.github.com/repos/esl/MongooseIM/statuses/{sha}","languages_url":"https://api.github.com/repos/esl/MongooseIM/languages","stargazers_url":"https://api.github.com/repos/esl/MongooseIM/stargazers","contributors_url":"https://api.github.com/repos/esl/MongooseIM/contributors","subscribers_url":"https://api.github.com/repos/esl/MongooseIM/subscribers","subscription_url":"https://api.github.com/repos/esl/MongooseIM/subscription","commits_url":"https://api.github.com/repos/esl/MongooseIM/commits{/sha}","git_commits_url":"https://api.github.com/repos/esl/MongooseIM/git/commits{/sha}","comments_url":"https://api.github.com/repos/esl/MongooseIM/comments{/number}","issue_comment_url":"https://api.github.com/repos/esl/MongooseIM/issues/comments{/number}","contents_url":"https://api.github.com/repos/esl/MongooseIM/contents/{+path}","compare_url":"https://api.github.com/repos/esl/MongooseIM/compare/{base}...{head}","merges_url":"https://api.github.com/repos/esl/MongooseIM/merges","archive_url":"https://api.github.com/repos/esl/MongooseIM/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/esl/MongooseIM/downloads","issues_url":"https://api.github.com/repos/esl/MongooseIM/issues{/number}","pulls_url":"https://api.github.com/repos/esl/MongooseIM/pulls{/number}","milestones_url":"https://api.github.com/repos/esl/MongooseIM/milestones{/number}","notifications_url":"https://api.github.com/repos/esl/MongooseIM/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/esl/MongooseIM/labels{/name}","releases_url":"https://api.github.com/repos/esl/MongooseIM/releases{/id}","deployments_url":"https://api.github.com/repos/esl/MongooseIM/deployments","created_at":"2011-09-09T08:19:18Z","updated_at":"2016-03-22T14:34:29Z","pushed_at":"2016-03-23T12:59:29Z","git_url":"git://github.com/esl/MongooseIM.git","ssh_url":"git@github.com:esl/MongooseIM.git","clone_url":"https://github.com/esl/MongooseIM.git","svn_url":"https://github.com/esl/MongooseIM","homepage":"https://www.erlang-solutions.com/products/mongooseim.html","size":27805,"stargazers_count":491,"watchers_count":491,"language":"Erlang","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":200,"mirror_url":null,"open_issues_count":69,"forks":200,"open_issues":69,"watchers":491,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/esl/MongooseIM/pulls/707"},"html":{"href":"https://github.com/esl/MongooseIM/pull/707"},"issue":{"href":"https://api.github.com/repos/esl/MongooseIM/issues/707"},"comments":{"href":"https://api.github.com/repos/esl/MongooseIM/issues/707/comments"},"review_comments":{"href":"https://api.github.com/repos/esl/MongooseIM/pulls/707/comments"},"review_comment":{"href":"https://api.github.com/repos/esl/MongooseIM/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/esl/MongooseIM/pulls/707/commits"},"statuses":{"href":"https://api.github.com/repos/esl/MongooseIM/statuses/dfd0968d9e20f6320321b2eb3ffe7680c4b3eb6f"}}}}