{"action":"created","comment":{"url":"https://api.github.com/repos/prometheus/node_exporter/pulls/comments/26899357","id":26899357,"diff_hunk":"@@ -0,0 +1,210 @@\n+// +build !notcpstat\n+\n+package collector\n+\n+import (\n+\t\"bufio\"\n+\t\"fmt\"\n+\t\"io\"\n+\t\"os\"\n+\t\"strconv\"\n+\t\"strings\"\n+\n+\t\"github.com/prometheus/client_golang/prometheus\"\n+)\n+\n+const (\n+\tprocTcpStat  = \"/proc/net/tcp\"\n+\tprocTcp6Stat = \"/proc/net/tcp6\"\n+)\n+\n+const (","path":"collector/tcpstat.go","position":21,"original_position":21,"commit_id":"eb446a4146c180c726545b11cd79d49880a4d9e8","original_commit_id":"eb446a4146c180c726545b11cd79d49880a4d9e8","user":{"login":"juliusv","id":538008,"avatar_url":"https://avatars.githubusercontent.com/u/538008?v=3","gravatar_id":"","url":"https://api.github.com/users/juliusv","html_url":"https://github.com/juliusv","followers_url":"https://api.github.com/users/juliusv/followers","following_url":"https://api.github.com/users/juliusv/following{/other_user}","gists_url":"https://api.github.com/users/juliusv/gists{/gist_id}","starred_url":"https://api.github.com/users/juliusv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juliusv/subscriptions","organizations_url":"https://api.github.com/users/juliusv/orgs","repos_url":"https://api.github.com/users/juliusv/repos","events_url":"https://api.github.com/users/juliusv/events{/privacy}","received_events_url":"https://api.github.com/users/juliusv/received_events","type":"User","site_admin":false},"body":"(corrected some typos in the above comment, but notification mails are only sent once, so just calling it out)","created_at":"2015-03-22T03:08:26Z","updated_at":"2015-03-22T03:08:26Z","html_url":"https://github.com/prometheus/node_exporter/pull/56#discussion_r26899357","pull_request_url":"https://api.github.com/repos/prometheus/node_exporter/pulls/56","_links":{"self":{"href":"https://api.github.com/repos/prometheus/node_exporter/pulls/comments/26899357"},"html":{"href":"https://github.com/prometheus/node_exporter/pull/56#discussion_r26899357"},"pull_request":{"href":"https://api.github.com/repos/prometheus/node_exporter/pulls/56"}}},"pull_request":{"url":"https://api.github.com/repos/prometheus/node_exporter/pulls/56","id":31579044,"html_url":"https://github.com/prometheus/node_exporter/pull/56","diff_url":"https://github.com/prometheus/node_exporter/pull/56.diff","patch_url":"https://github.com/prometheus/node_exporter/pull/56.patch","issue_url":"https://api.github.com/repos/prometheus/node_exporter/issues/56","number":56,"state":"open","locked":false,"title":"Add TCP state collector","user":{"login":"kjmkznr","id":85144,"avatar_url":"https://avatars.githubusercontent.com/u/85144?v=3","gravatar_id":"","url":"https://api.github.com/users/kjmkznr","html_url":"https://github.com/kjmkznr","followers_url":"https://api.github.com/users/kjmkznr/followers","following_url":"https://api.github.com/users/kjmkznr/following{/other_user}","gists_url":"https://api.github.com/users/kjmkznr/gists{/gist_id}","starred_url":"https://api.github.com/users/kjmkznr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kjmkznr/subscriptions","organizations_url":"https://api.github.com/users/kjmkznr/orgs","repos_url":"https://api.github.com/users/kjmkznr/repos","events_url":"https://api.github.com/users/kjmkznr/events{/privacy}","received_events_url":"https://api.github.com/users/kjmkznr/received_events","type":"User","site_admin":false},"body":"This collector expose following metrics:\r\n\r\n* Number of TCP ESTABLISHED connections\r\n* Number of TCP LISTEN ports\r\n* Number of TCP SYN_SENT state connections\r\n* Number of TCP SYN_RECV state connections\r\n* Number of TCP FIN_WAIT1 state connections\r\n* Number of TCP FIN_WATI2 state connections\r\n* Number of TCP TIME_WAIT state connections\r\n* Number of TCP CLOSE state connections\r\n* Number of TCP CLOSE_WAIT state connections\r\n* Number of TCP LAST_ACK state connections\r\n* Number of TCP CLOSING state connections\r\n","created_at":"2015-03-20T00:23:21Z","updated_at":"2015-03-22T03:08:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"21891d35f81a8bd67dce7ad733a09c563318e67c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/prometheus/node_exporter/pulls/56/commits","review_comments_url":"https://api.github.com/repos/prometheus/node_exporter/pulls/56/comments","review_comment_url":"https://api.github.com/repos/prometheus/node_exporter/pulls/comments{/number}","comments_url":"https://api.github.com/repos/prometheus/node_exporter/issues/56/comments","statuses_url":"https://api.github.com/repos/prometheus/node_exporter/statuses/eb446a4146c180c726545b11cd79d49880a4d9e8","head":{"label":"kjmkznr:add-tcp-stat-collector","ref":"add-tcp-stat-collector","sha":"eb446a4146c180c726545b11cd79d49880a4d9e8","user":{"login":"kjmkznr","id":85144,"avatar_url":"https://avatars.githubusercontent.com/u/85144?v=3","gravatar_id":"","url":"https://api.github.com/users/kjmkznr","html_url":"https://github.com/kjmkznr","followers_url":"https://api.github.com/users/kjmkznr/followers","following_url":"https://api.github.com/users/kjmkznr/following{/other_user}","gists_url":"https://api.github.com/users/kjmkznr/gists{/gist_id}","starred_url":"https://api.github.com/users/kjmkznr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kjmkznr/subscriptions","organizations_url":"https://api.github.com/users/kjmkznr/orgs","repos_url":"https://api.github.com/users/kjmkznr/repos","events_url":"https://api.github.com/users/kjmkznr/events{/privacy}","received_events_url":"https://api.github.com/users/kjmkznr/received_events","type":"User","site_admin":false},"repo":{"id":32453938,"name":"node_exporter","full_name":"kjmkznr/node_exporter","owner":{"login":"kjmkznr","id":85144,"avatar_url":"https://avatars.githubusercontent.com/u/85144?v=3","gravatar_id":"","url":"https://api.github.com/users/kjmkznr","html_url":"https://github.com/kjmkznr","followers_url":"https://api.github.com/users/kjmkznr/followers","following_url":"https://api.github.com/users/kjmkznr/following{/other_user}","gists_url":"https://api.github.com/users/kjmkznr/gists{/gist_id}","starred_url":"https://api.github.com/users/kjmkznr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kjmkznr/subscriptions","organizations_url":"https://api.github.com/users/kjmkznr/orgs","repos_url":"https://api.github.com/users/kjmkznr/repos","events_url":"https://api.github.com/users/kjmkznr/events{/privacy}","received_events_url":"https://api.github.com/users/kjmkznr/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kjmkznr/node_exporter","description":"Exporter for machine metrics","fork":true,"url":"https://api.github.com/repos/kjmkznr/node_exporter","forks_url":"https://api.github.com/repos/kjmkznr/node_exporter/forks","keys_url":"https://api.github.com/repos/kjmkznr/node_exporter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kjmkznr/node_exporter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kjmkznr/node_exporter/teams","hooks_url":"https://api.github.com/repos/kjmkznr/node_exporter/hooks","issue_events_url":"https://api.github.com/repos/kjmkznr/node_exporter/issues/events{/number}","events_url":"https://api.github.com/repos/kjmkznr/node_exporter/events","assignees_url":"https://api.github.com/repos/kjmkznr/node_exporter/assignees{/user}","branches_url":"https://api.github.com/repos/kjmkznr/node_exporter/branches{/branch}","tags_url":"https://api.github.com/repos/kjmkznr/node_exporter/tags","blobs_url":"https://api.github.com/repos/kjmkznr/node_exporter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kjmkznr/node_exporter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kjmkznr/node_exporter/git/refs{/sha}","trees_url":"https://api.github.com/repos/kjmkznr/node_exporter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kjmkznr/node_exporter/statuses/{sha}","languages_url":"https://api.github.com/repos/kjmkznr/node_exporter/languages","stargazers_url":"https://api.github.com/repos/kjmkznr/node_exporter/stargazers","contributors_url":"https://api.github.com/repos/kjmkznr/node_exporter/contributors","subscribers_url":"https://api.github.com/repos/kjmkznr/node_exporter/subscribers","subscription_url":"https://api.github.com/repos/kjmkznr/node_exporter/subscription","commits_url":"https://api.github.com/repos/kjmkznr/node_exporter/commits{/sha}","git_commits_url":"https://api.github.com/repos/kjmkznr/node_exporter/git/commits{/sha}","comments_url":"https://api.github.com/repos/kjmkznr/node_exporter/comments{/number}","issue_comment_url":"https://api.github.com/repos/kjmkznr/node_exporter/issues/comments{/number}","contents_url":"https://api.github.com/repos/kjmkznr/node_exporter/contents/{+path}","compare_url":"https://api.github.com/repos/kjmkznr/node_exporter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kjmkznr/node_exporter/merges","archive_url":"https://api.github.com/repos/kjmkznr/node_exporter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kjmkznr/node_exporter/downloads","issues_url":"https://api.github.com/repos/kjmkznr/node_exporter/issues{/number}","pulls_url":"https://api.github.com/repos/kjmkznr/node_exporter/pulls{/number}","milestones_url":"https://api.github.com/repos/kjmkznr/node_exporter/milestones{/number}","notifications_url":"https://api.github.com/repos/kjmkznr/node_exporter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kjmkznr/node_exporter/labels{/name}","releases_url":"https://api.github.com/repos/kjmkznr/node_exporter/releases{/id}","created_at":"2015-03-18T11:04:58Z","updated_at":"2015-03-18T11:04:58Z","pushed_at":"2015-03-20T00:21:20Z","git_url":"git://github.com/kjmkznr/node_exporter.git","ssh_url":"git@github.com:kjmkznr/node_exporter.git","clone_url":"https://github.com/kjmkznr/node_exporter.git","svn_url":"https://github.com/kjmkznr/node_exporter","homepage":"http://prometheus.io/","size":218,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"prometheus:master","ref":"master","sha":"aaf01e52e25883671fd67234b415df7abd0e4eac","user":{"login":"prometheus","id":3380462,"avatar_url":"https://avatars.githubusercontent.com/u/3380462?v=3","gravatar_id":"","url":"https://api.github.com/users/prometheus","html_url":"https://github.com/prometheus","followers_url":"https://api.github.com/users/prometheus/followers","following_url":"https://api.github.com/users/prometheus/following{/other_user}","gists_url":"https://api.github.com/users/prometheus/gists{/gist_id}","starred_url":"https://api.github.com/users/prometheus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prometheus/subscriptions","organizations_url":"https://api.github.com/users/prometheus/orgs","repos_url":"https://api.github.com/users/prometheus/repos","events_url":"https://api.github.com/users/prometheus/events{/privacy}","received_events_url":"https://api.github.com/users/prometheus/received_events","type":"Organization","site_admin":false},"repo":{"id":9524057,"name":"node_exporter","full_name":"prometheus/node_exporter","owner":{"login":"prometheus","id":3380462,"avatar_url":"https://avatars.githubusercontent.com/u/3380462?v=3","gravatar_id":"","url":"https://api.github.com/users/prometheus","html_url":"https://github.com/prometheus","followers_url":"https://api.github.com/users/prometheus/followers","following_url":"https://api.github.com/users/prometheus/following{/other_user}","gists_url":"https://api.github.com/users/prometheus/gists{/gist_id}","starred_url":"https://api.github.com/users/prometheus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prometheus/subscriptions","organizations_url":"https://api.github.com/users/prometheus/orgs","repos_url":"https://api.github.com/users/prometheus/repos","events_url":"https://api.github.com/users/prometheus/events{/privacy}","received_events_url":"https://api.github.com/users/prometheus/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/prometheus/node_exporter","description":"Exporter for machine metrics","fork":false,"url":"https://api.github.com/repos/prometheus/node_exporter","forks_url":"https://api.github.com/repos/prometheus/node_exporter/forks","keys_url":"https://api.github.com/repos/prometheus/node_exporter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/prometheus/node_exporter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/prometheus/node_exporter/teams","hooks_url":"https://api.github.com/repos/prometheus/node_exporter/hooks","issue_events_url":"https://api.github.com/repos/prometheus/node_exporter/issues/events{/number}","events_url":"https://api.github.com/repos/prometheus/node_exporter/events","assignees_url":"https://api.github.com/repos/prometheus/node_exporter/assignees{/user}","branches_url":"https://api.github.com/repos/prometheus/node_exporter/branches{/branch}","tags_url":"https://api.github.com/repos/prometheus/node_exporter/tags","blobs_url":"https://api.github.com/repos/prometheus/node_exporter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/prometheus/node_exporter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/prometheus/node_exporter/git/refs{/sha}","trees_url":"https://api.github.com/repos/prometheus/node_exporter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/prometheus/node_exporter/statuses/{sha}","languages_url":"https://api.github.com/repos/prometheus/node_exporter/languages","stargazers_url":"https://api.github.com/repos/prometheus/node_exporter/stargazers","contributors_url":"https://api.github.com/repos/prometheus/node_exporter/contributors","subscribers_url":"https://api.github.com/repos/prometheus/node_exporter/subscribers","subscription_url":"https://api.github.com/repos/prometheus/node_exporter/subscription","commits_url":"https://api.github.com/repos/prometheus/node_exporter/commits{/sha}","git_commits_url":"https://api.github.com/repos/prometheus/node_exporter/git/commits{/sha}","comments_url":"https://api.github.com/repos/prometheus/node_exporter/comments{/number}","issue_comment_url":"https://api.github.com/repos/prometheus/node_exporter/issues/comments{/number}","contents_url":"https://api.github.com/repos/prometheus/node_exporter/contents/{+path}","compare_url":"https://api.github.com/repos/prometheus/node_exporter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/prometheus/node_exporter/merges","archive_url":"https://api.github.com/repos/prometheus/node_exporter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/prometheus/node_exporter/downloads","issues_url":"https://api.github.com/repos/prometheus/node_exporter/issues{/number}","pulls_url":"https://api.github.com/repos/prometheus/node_exporter/pulls{/number}","milestones_url":"https://api.github.com/repos/prometheus/node_exporter/milestones{/number}","notifications_url":"https://api.github.com/repos/prometheus/node_exporter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/prometheus/node_exporter/labels{/name}","releases_url":"https://api.github.com/repos/prometheus/node_exporter/releases{/id}","created_at":"2013-04-18T14:44:52Z","updated_at":"2015-03-21T16:37:00Z","pushed_at":"2015-03-22T00:19:50Z","git_url":"git://github.com/prometheus/node_exporter.git","ssh_url":"git@github.com:prometheus/node_exporter.git","clone_url":"https://github.com/prometheus/node_exporter.git","svn_url":"https://github.com/prometheus/node_exporter","homepage":"http://prometheus.io/","size":2990,"stargazers_count":18,"watchers_count":18,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":7,"forks":10,"open_issues":7,"watchers":18,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/prometheus/node_exporter/pulls/56"},"html":{"href":"https://github.com/prometheus/node_exporter/pull/56"},"issue":{"href":"https://api.github.com/repos/prometheus/node_exporter/issues/56"},"comments":{"href":"https://api.github.com/repos/prometheus/node_exporter/issues/56/comments"},"review_comments":{"href":"https://api.github.com/repos/prometheus/node_exporter/pulls/56/comments"},"review_comment":{"href":"https://api.github.com/repos/prometheus/node_exporter/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/prometheus/node_exporter/pulls/56/commits"},"statuses":{"href":"https://api.github.com/repos/prometheus/node_exporter/statuses/eb446a4146c180c726545b11cd79d49880a4d9e8"}}}}