{"action":"created","comment":{"url":"https://api.github.com/repos/status-im/status-go/pulls/comments/345698652","pull_request_review_id":316164369,"id":345698652,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDM0NTY5ODY1Mg==","diff_hunk":"@@ -0,0 +1,95 @@\n+package tcpping\n+\n+import (\n+\t\"context\"\n+\t\"fmt\"\n+\t\"time\"\n+\n+\terrors \"github.com/pkg/errors\"\n+\ttcp \"github.com/tevino/tcp-shaker\"\n+)\n+\n+type Result struct {\n+\tAddress string\n+\tLatency int\n+\tPingErr error\n+}\n+\n+func (cr *Result) String() string {\n+\treturn fmt.Sprintf(\n+\t\t\"Result{address: %s, latency: %d, error: %s}\\n\",\n+\t\tcr.Address, cr.Latency, cr.PingErr)\n+}\n+\n+func runCheck(c *tcp.Checker, address string, resChan chan Result, timeout time.Duration) {\n+\t// mesaure RTT\n+\tstart := time.Now()\n+\t// TCP Ping\n+\terr := c.CheckAddr(address, timeout)\n+\t// measure RTT\n+\telapsed := time.Since(start)\n+\tlatency := int(elapsed.Milliseconds())\n+\n+\tif err != nil { // don't confuse users with valid latency values on error\n+\t\tlatency = -1\n+\t\tif err == tcp.ErrTimeout {\n+\t\t\terr = errors.Wrap(err, \"tcp check timeout\")\n+\t\t} else {\n+\t\t\tswitch err.(type) {\n+\t\t\tcase tcp.ErrConnect:\n+\t\t\t\terr = errors.Wrap(err, \"unable to connect\")\n+\t\t\tdefault:\n+\t\t\t\terr = errors.Wrap(err, \"unknown error\")\n+\t\t\t}\n+\t\t}\n+\t}\n+\n+\t// return results\n+\tresChan <- Result{\n+\t\tAddress: address,\n+\t\tLatency: latency,\n+\t\tPingErr: err,\n+\t}\n+}\n+\n+func waitForResults(resChan chan Result, expected int, timeout time.Duration) ([]Result, error) {","path":"tcpping/tcpping.go","position":null,"original_position":55,"commit_id":"d3c4ca09f7cecf293430e0df4282518f52770af3","original_commit_id":"792e6f3b46c8187cc9fc63818503007b1cd898eb","user":{"login":"jakubgs","id":2212681,"node_id":"MDQ6VXNlcjIyMTI2ODE=","avatar_url":"https://avatars2.githubusercontent.com/u/2212681?v=4","gravatar_id":"","url":"https://api.github.com/users/jakubgs","html_url":"https://github.com/jakubgs","followers_url":"https://api.github.com/users/jakubgs/followers","following_url":"https://api.github.com/users/jakubgs/following{/other_user}","gists_url":"https://api.github.com/users/jakubgs/gists{/gist_id}","starred_url":"https://api.github.com/users/jakubgs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jakubgs/subscriptions","organizations_url":"https://api.github.com/users/jakubgs/orgs","repos_url":"https://api.github.com/users/jakubgs/repos","events_url":"https://api.github.com/users/jakubgs/events{/privacy}","received_events_url":"https://api.github.com/users/jakubgs/received_events","type":"User","site_admin":false},"body":"much cleaner, nice","created_at":"2019-11-13T11:07:52Z","updated_at":"2019-11-13T11:07:52Z","html_url":"https://github.com/status-im/status-go/pull/1672#discussion_r345698652","pull_request_url":"https://api.github.com/repos/status-im/status-go/pulls/1672","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/status-im/status-go/pulls/comments/345698652"},"html":{"href":"https://github.com/status-im/status-go/pull/1672#discussion_r345698652"},"pull_request":{"href":"https://api.github.com/repos/status-im/status-go/pulls/1672"}},"in_reply_to_id":345591735},"pull_request":{"url":"https://api.github.com/repos/status-im/status-go/pulls/1672","id":340033122,"node_id":"MDExOlB1bGxSZXF1ZXN0MzQwMDMzMTIy","html_url":"https://github.com/status-im/status-go/pull/1672","diff_url":"https://github.com/status-im/status-go/pull/1672.diff","patch_url":"https://github.com/status-im/status-go/pull/1672.patch","issue_url":"https://api.github.com/repos/status-im/status-go/issues/1672","number":1672,"state":"open","locked":false,"title":"[WIP] add tcp-pinger for mailservers","user":{"login":"jakubgs","id":2212681,"node_id":"MDQ6VXNlcjIyMTI2ODE=","avatar_url":"https://avatars2.githubusercontent.com/u/2212681?v=4","gravatar_id":"","url":"https://api.github.com/users/jakubgs","html_url":"https://github.com/jakubgs","followers_url":"https://api.github.com/users/jakubgs/followers","following_url":"https://api.github.com/users/jakubgs/following{/other_user}","gists_url":"https://api.github.com/users/jakubgs/gists{/gist_id}","starred_url":"https://api.github.com/users/jakubgs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jakubgs/subscriptions","organizations_url":"https://api.github.com/users/jakubgs/orgs","repos_url":"https://api.github.com/users/jakubgs/repos","events_url":"https://api.github.com/users/jakubgs/events{/privacy}","received_events_url":"https://api.github.com/users/jakubgs/received_events","type":"User","site_admin":false},"body":"This is an initial version of implementation of an RPC call for checking latency of mailservers.\r\n\r\nPartially resolves https://github.com/status-im/status-react/issues/9394.\r\n\r\nStatus: __WIP__","created_at":"2019-11-12T17:50:07Z","updated_at":"2019-11-13T11:07:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4bf2f327788746d17c556204d28fae4af22ebd91","assignee":{"login":"jakubgs","id":2212681,"node_id":"MDQ6VXNlcjIyMTI2ODE=","avatar_url":"https://avatars2.githubusercontent.com/u/2212681?v=4","gravatar_id":"","url":"https://api.github.com/users/jakubgs","html_url":"https://github.com/jakubgs","followers_url":"https://api.github.com/users/jakubgs/followers","following_url":"https://api.github.com/users/jakubgs/following{/other_user}","gists_url":"https://api.github.com/users/jakubgs/gists{/gist_id}","starred_url":"https://api.github.com/users/jakubgs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jakubgs/subscriptions","organizations_url":"https://api.github.com/users/jakubgs/orgs","repos_url":"https://api.github.com/users/jakubgs/repos","events_url":"https://api.github.com/users/jakubgs/events{/privacy}","received_events_url":"https://api.github.com/users/jakubgs/received_events","type":"User","site_admin":false},"assignees":[{"login":"jakubgs","id":2212681,"node_id":"MDQ6VXNlcjIyMTI2ODE=","avatar_url":"https://avatars2.githubusercontent.com/u/2212681?v=4","gravatar_id":"","url":"https://api.github.com/users/jakubgs","html_url":"https://github.com/jakubgs","followers_url":"https://api.github.com/users/jakubgs/followers","following_url":"https://api.github.com/users/jakubgs/following{/other_user}","gists_url":"https://api.github.com/users/jakubgs/gists{/gist_id}","starred_url":"https://api.github.com/users/jakubgs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jakubgs/subscriptions","organizations_url":"https://api.github.com/users/jakubgs/orgs","repos_url":"https://api.github.com/users/jakubgs/repos","events_url":"https://api.github.com/users/jakubgs/events{/privacy}","received_events_url":"https://api.github.com/users/jakubgs/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"cammellos","id":1017008,"node_id":"MDQ6VXNlcjEwMTcwMDg=","avatar_url":"https://avatars0.githubusercontent.com/u/1017008?v=4","gravatar_id":"","url":"https://api.github.com/users/cammellos","html_url":"https://github.com/cammellos","followers_url":"https://api.github.com/users/cammellos/followers","following_url":"https://api.github.com/users/cammellos/following{/other_user}","gists_url":"https://api.github.com/users/cammellos/gists{/gist_id}","starred_url":"https://api.github.com/users/cammellos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cammellos/subscriptions","organizations_url":"https://api.github.com/users/cammellos/orgs","repos_url":"https://api.github.com/users/cammellos/repos","events_url":"https://api.github.com/users/cammellos/events{/privacy}","received_events_url":"https://api.github.com/users/cammellos/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/status-im/status-go/pulls/1672/commits","review_comments_url":"https://api.github.com/repos/status-im/status-go/pulls/1672/comments","review_comment_url":"https://api.github.com/repos/status-im/status-go/pulls/comments{/number}","comments_url":"https://api.github.com/repos/status-im/status-go/issues/1672/comments","statuses_url":"https://api.github.com/repos/status-im/status-go/statuses/d3c4ca09f7cecf293430e0df4282518f52770af3","head":{"label":"status-im:mailserver-tcp-pinger","ref":"mailserver-tcp-pinger","sha":"d3c4ca09f7cecf293430e0df4282518f52770af3","user":{"login":"status-im","id":11767950,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExNzY3OTUw","avatar_url":"https://avatars1.githubusercontent.com/u/11767950?v=4","gravatar_id":"","url":"https://api.github.com/users/status-im","html_url":"https://github.com/status-im","followers_url":"https://api.github.com/users/status-im/followers","following_url":"https://api.github.com/users/status-im/following{/other_user}","gists_url":"https://api.github.com/users/status-im/gists{/gist_id}","starred_url":"https://api.github.com/users/status-im/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/status-im/subscriptions","organizations_url":"https://api.github.com/users/status-im/orgs","repos_url":"https://api.github.com/users/status-im/repos","events_url":"https://api.github.com/users/status-im/events{/privacy}","received_events_url":"https://api.github.com/users/status-im/received_events","type":"Organization","site_admin":false},"repo":{"id":61047867,"node_id":"MDEwOlJlcG9zaXRvcnk2MTA0Nzg2Nw==","name":"status-go","full_name":"status-im/status-go","private":false,"owner":{"login":"status-im","id":11767950,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExNzY3OTUw","avatar_url":"https://avatars1.githubusercontent.com/u/11767950?v=4","gravatar_id":"","url":"https://api.github.com/users/status-im","html_url":"https://github.com/status-im","followers_url":"https://api.github.com/users/status-im/followers","following_url":"https://api.github.com/users/status-im/following{/other_user}","gists_url":"https://api.github.com/users/status-im/gists{/gist_id}","starred_url":"https://api.github.com/users/status-im/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/status-im/subscriptions","organizations_url":"https://api.github.com/users/status-im/orgs","repos_url":"https://api.github.com/users/status-im/repos","events_url":"https://api.github.com/users/status-im/events{/privacy}","received_events_url":"https://api.github.com/users/status-im/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/status-im/status-go","description":"The Status module that consumes go-ethereum","fork":false,"url":"https://api.github.com/repos/status-im/status-go","forks_url":"https://api.github.com/repos/status-im/status-go/forks","keys_url":"https://api.github.com/repos/status-im/status-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/status-im/status-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/status-im/status-go/teams","hooks_url":"https://api.github.com/repos/status-im/status-go/hooks","issue_events_url":"https://api.github.com/repos/status-im/status-go/issues/events{/number}","events_url":"https://api.github.com/repos/status-im/status-go/events","assignees_url":"https://api.github.com/repos/status-im/status-go/assignees{/user}","branches_url":"https://api.github.com/repos/status-im/status-go/branches{/branch}","tags_url":"https://api.github.com/repos/status-im/status-go/tags","blobs_url":"https://api.github.com/repos/status-im/status-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/status-im/status-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/status-im/status-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/status-im/status-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/status-im/status-go/statuses/{sha}","languages_url":"https://api.github.com/repos/status-im/status-go/languages","stargazers_url":"https://api.github.com/repos/status-im/status-go/stargazers","contributors_url":"https://api.github.com/repos/status-im/status-go/contributors","subscribers_url":"https://api.github.com/repos/status-im/status-go/subscribers","subscription_url":"https://api.github.com/repos/status-im/status-go/subscription","commits_url":"https://api.github.com/repos/status-im/status-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/status-im/status-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/status-im/status-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/status-im/status-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/status-im/status-go/contents/{+path}","compare_url":"https://api.github.com/repos/status-im/status-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/status-im/status-go/merges","archive_url":"https://api.github.com/repos/status-im/status-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/status-im/status-go/downloads","issues_url":"https://api.github.com/repos/status-im/status-go/issues{/number}","pulls_url":"https://api.github.com/repos/status-im/status-go/pulls{/number}","milestones_url":"https://api.github.com/repos/status-im/status-go/milestones{/number}","notifications_url":"https://api.github.com/repos/status-im/status-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/status-im/status-go/labels{/name}","releases_url":"https://api.github.com/repos/status-im/status-go/releases{/id}","deployments_url":"https://api.github.com/repos/status-im/status-go/deployments","created_at":"2016-06-13T15:32:03Z","updated_at":"2019-11-08T07:36:17Z","pushed_at":"2019-11-13T11:06:52Z","git_url":"git://github.com/status-im/status-go.git","ssh_url":"git@github.com:status-im/status-go.git","clone_url":"https://github.com/status-im/status-go.git","svn_url":"https://github.com/status-im/status-go","homepage":"https://status.im","size":55215,"stargazers_count":515,"watchers_count":515,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":161,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":68,"license":{"key":"mpl-2.0","name":"Mozilla Public License 2.0","spdx_id":"MPL-2.0","url":"https://api.github.com/licenses/mpl-2.0","node_id":"MDc6TGljZW5zZTE0"},"forks":161,"open_issues":68,"watchers":515,"default_branch":"develop"}},"base":{"label":"status-im:develop","ref":"develop","sha":"89659f85b49b48f4409ed9f522397b99728b214b","user":{"login":"status-im","id":11767950,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExNzY3OTUw","avatar_url":"https://avatars1.githubusercontent.com/u/11767950?v=4","gravatar_id":"","url":"https://api.github.com/users/status-im","html_url":"https://github.com/status-im","followers_url":"https://api.github.com/users/status-im/followers","following_url":"https://api.github.com/users/status-im/following{/other_user}","gists_url":"https://api.github.com/users/status-im/gists{/gist_id}","starred_url":"https://api.github.com/users/status-im/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/status-im/subscriptions","organizations_url":"https://api.github.com/users/status-im/orgs","repos_url":"https://api.github.com/users/status-im/repos","events_url":"https://api.github.com/users/status-im/events{/privacy}","received_events_url":"https://api.github.com/users/status-im/received_events","type":"Organization","site_admin":false},"repo":{"id":61047867,"node_id":"MDEwOlJlcG9zaXRvcnk2MTA0Nzg2Nw==","name":"status-go","full_name":"status-im/status-go","private":false,"owner":{"login":"status-im","id":11767950,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExNzY3OTUw","avatar_url":"https://avatars1.githubusercontent.com/u/11767950?v=4","gravatar_id":"","url":"https://api.github.com/users/status-im","html_url":"https://github.com/status-im","followers_url":"https://api.github.com/users/status-im/followers","following_url":"https://api.github.com/users/status-im/following{/other_user}","gists_url":"https://api.github.com/users/status-im/gists{/gist_id}","starred_url":"https://api.github.com/users/status-im/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/status-im/subscriptions","organizations_url":"https://api.github.com/users/status-im/orgs","repos_url":"https://api.github.com/users/status-im/repos","events_url":"https://api.github.com/users/status-im/events{/privacy}","received_events_url":"https://api.github.com/users/status-im/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/status-im/status-go","description":"The Status module that consumes go-ethereum","fork":false,"url":"https://api.github.com/repos/status-im/status-go","forks_url":"https://api.github.com/repos/status-im/status-go/forks","keys_url":"https://api.github.com/repos/status-im/status-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/status-im/status-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/status-im/status-go/teams","hooks_url":"https://api.github.com/repos/status-im/status-go/hooks","issue_events_url":"https://api.github.com/repos/status-im/status-go/issues/events{/number}","events_url":"https://api.github.com/repos/status-im/status-go/events","assignees_url":"https://api.github.com/repos/status-im/status-go/assignees{/user}","branches_url":"https://api.github.com/repos/status-im/status-go/branches{/branch}","tags_url":"https://api.github.com/repos/status-im/status-go/tags","blobs_url":"https://api.github.com/repos/status-im/status-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/status-im/status-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/status-im/status-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/status-im/status-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/status-im/status-go/statuses/{sha}","languages_url":"https://api.github.com/repos/status-im/status-go/languages","stargazers_url":"https://api.github.com/repos/status-im/status-go/stargazers","contributors_url":"https://api.github.com/repos/status-im/status-go/contributors","subscribers_url":"https://api.github.com/repos/status-im/status-go/subscribers","subscription_url":"https://api.github.com/repos/status-im/status-go/subscription","commits_url":"https://api.github.com/repos/status-im/status-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/status-im/status-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/status-im/status-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/status-im/status-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/status-im/status-go/contents/{+path}","compare_url":"https://api.github.com/repos/status-im/status-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/status-im/status-go/merges","archive_url":"https://api.github.com/repos/status-im/status-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/status-im/status-go/downloads","issues_url":"https://api.github.com/repos/status-im/status-go/issues{/number}","pulls_url":"https://api.github.com/repos/status-im/status-go/pulls{/number}","milestones_url":"https://api.github.com/repos/status-im/status-go/milestones{/number}","notifications_url":"https://api.github.com/repos/status-im/status-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/status-im/status-go/labels{/name}","releases_url":"https://api.github.com/repos/status-im/status-go/releases{/id}","deployments_url":"https://api.github.com/repos/status-im/status-go/deployments","created_at":"2016-06-13T15:32:03Z","updated_at":"2019-11-08T07:36:17Z","pushed_at":"2019-11-13T11:06:52Z","git_url":"git://github.com/status-im/status-go.git","ssh_url":"git@github.com:status-im/status-go.git","clone_url":"https://github.com/status-im/status-go.git","svn_url":"https://github.com/status-im/status-go","homepage":"https://status.im","size":55215,"stargazers_count":515,"watchers_count":515,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":161,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":68,"license":{"key":"mpl-2.0","name":"Mozilla Public License 2.0","spdx_id":"MPL-2.0","url":"https://api.github.com/licenses/mpl-2.0","node_id":"MDc6TGljZW5zZTE0"},"forks":161,"open_issues":68,"watchers":515,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/status-im/status-go/pulls/1672"},"html":{"href":"https://github.com/status-im/status-go/pull/1672"},"issue":{"href":"https://api.github.com/repos/status-im/status-go/issues/1672"},"comments":{"href":"https://api.github.com/repos/status-im/status-go/issues/1672/comments"},"review_comments":{"href":"https://api.github.com/repos/status-im/status-go/pulls/1672/comments"},"review_comment":{"href":"https://api.github.com/repos/status-im/status-go/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/status-im/status-go/pulls/1672/commits"},"statuses":{"href":"https://api.github.com/repos/status-im/status-go/statuses/d3c4ca09f7cecf293430e0df4282518f52770af3"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"jakubgs"}}