{"action":"created","comment":{"url":"https://api.github.com/repos/raintank/metrictank/pulls/comments/88776082","pull_request_review_id":9342331,"id":88776082,"diff_hunk":"@@ -15,4 +38,85 @@ func Init(name, version string, primary bool, started time.Time) {\n \t\tprimaryChange: time.Now(),\n \t\tstateChange:   time.Now(),\n \t}\n+\tMode = m\n+\tgo probePeers(interval)\n+}\n+\n+func Stop() {\n+\tclose(shutdown)\n+}\n+\n+func AddPeer(remoteAddr *url.URL) {\n+\tmu.Lock()\n+\tpeer := &Node{\n+\t\tremoteAddr:  remoteAddr,\n+\t\tstateChange: time.Now(),\n+\t}\n+\tpeers = append(peers, peer)\n+\tgo peer.Probe()\n+\tmu.Unlock()\n+}\n+\n+func GetPeers() []*Node {\n+\tmu.Lock()\n+\tp := make([]*Node, len(peers))\n+\tcopy(p, peers)\n+\tmu.Unlock()\n+\treturn p\n+}\n+\n+func probePeers(interval time.Duration) {\n+\tticker := time.NewTicker(interval)\n+\tfor {\n+\t\tselect {\n+\t\tcase <-shutdown:\n+\t\t\tticker.Stop()\n+\t\t\treturn\n+\t\tcase <-ticker.C:\n+\t\t\tmu.Lock()\n+\t\t\tfor _, peer := range peers {\n+\t\t\t\tgo peer.Probe()","path":"cluster/cluster.go","position":80,"original_position":79,"commit_id":"3dc473a2c72b7a6f9996bf823d4eef205c16208b","original_commit_id":"885cd32e1c2c912744cb4ea6c2b8b024f928c820","user":{"login":"woodsaj","id":8415072,"avatar_url":"https://avatars.githubusercontent.com/u/8415072?v=3","gravatar_id":"","url":"https://api.github.com/users/woodsaj","html_url":"https://github.com/woodsaj","followers_url":"https://api.github.com/users/woodsaj/followers","following_url":"https://api.github.com/users/woodsaj/following{/other_user}","gists_url":"https://api.github.com/users/woodsaj/gists{/gist_id}","starred_url":"https://api.github.com/users/woodsaj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/woodsaj/subscriptions","organizations_url":"https://api.github.com/users/woodsaj/orgs","repos_url":"https://api.github.com/users/woodsaj/repos","events_url":"https://api.github.com/users/woodsaj/events{/privacy}","received_events_url":"https://api.github.com/users/woodsaj/received_events","type":"User","site_admin":false},"body":"ohh, i clobbered the change when i reverted a commit.\r\n\r\nhttps://github.com/raintank/metrictank/blob/clustering/cluster/node.go#L133-L139\r\n","created_at":"2016-11-19T09:14:06Z","updated_at":"2016-11-19T09:14:06Z","html_url":"https://github.com/raintank/metrictank/pull/400#discussion_r88776082","pull_request_url":"https://api.github.com/repos/raintank/metrictank/pulls/400","_links":{"self":{"href":"https://api.github.com/repos/raintank/metrictank/pulls/comments/88776082"},"html":{"href":"https://github.com/raintank/metrictank/pull/400#discussion_r88776082"},"pull_request":{"href":"https://api.github.com/repos/raintank/metrictank/pulls/400"}}},"pull_request":{"url":"https://api.github.com/repos/raintank/metrictank/pulls/400","id":94234253,"html_url":"https://github.com/raintank/metrictank/pull/400","diff_url":"https://github.com/raintank/metrictank/pull/400.diff","patch_url":"https://github.com/raintank/metrictank/pull/400.patch","issue_url":"https://api.github.com/repos/raintank/metrictank/issues/400","number":400,"state":"open","locked":false,"title":"Clustering","user":{"login":"woodsaj","id":8415072,"avatar_url":"https://avatars.githubusercontent.com/u/8415072?v=3","gravatar_id":"","url":"https://api.github.com/users/woodsaj","html_url":"https://github.com/woodsaj","followers_url":"https://api.github.com/users/woodsaj/followers","following_url":"https://api.github.com/users/woodsaj/following{/other_user}","gists_url":"https://api.github.com/users/woodsaj/gists{/gist_id}","starred_url":"https://api.github.com/users/woodsaj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/woodsaj/subscriptions","organizations_url":"https://api.github.com/users/woodsaj/orgs","repos_url":"https://api.github.com/users/woodsaj/repos","events_url":"https://api.github.com/users/woodsaj/events{/privacy}","received_events_url":"https://api.github.com/users/woodsaj/received_events","type":"User","site_admin":false},"body":"- keep track of nodes in the cluster\r\n- assign \"partitions\" to each node\r\n- include partition info in the metric index for each metric\r\n- update MetricIndex plugins to be partition aware\r\n  - this means the data stored in the backend stores will change so we will need to provide some migration tools.\r\n- make carbon and kafkamdm input plugins partition aware\r\n- when calling graphite's /render api fan out the request to\r\n  one node for each partition\r\n- when calling graphite's /metrics/find api fan out the requests\r\n  to one node for each partition\r\n- when calling graphites /metrics/index.jon api fan out the requests\r\n  to one node for each partition\r\n- add internal \"cluster\" api's to support the clustered graphite api\r\n  requests","created_at":"2016-11-17T19:32:09Z","updated_at":"2016-11-19T09:14:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e9fdbea9d5b3d83ad0bc22a770afc2828fdf3e1c","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/raintank/metrictank/pulls/400/commits","review_comments_url":"https://api.github.com/repos/raintank/metrictank/pulls/400/comments","review_comment_url":"https://api.github.com/repos/raintank/metrictank/pulls/comments{/number}","comments_url":"https://api.github.com/repos/raintank/metrictank/issues/400/comments","statuses_url":"https://api.github.com/repos/raintank/metrictank/statuses/3dc473a2c72b7a6f9996bf823d4eef205c16208b","head":{"label":"raintank:clustering","ref":"clustering","sha":"3dc473a2c72b7a6f9996bf823d4eef205c16208b","user":{"login":"raintank","id":8512431,"avatar_url":"https://avatars.githubusercontent.com/u/8512431?v=3","gravatar_id":"","url":"https://api.github.com/users/raintank","html_url":"https://github.com/raintank","followers_url":"https://api.github.com/users/raintank/followers","following_url":"https://api.github.com/users/raintank/following{/other_user}","gists_url":"https://api.github.com/users/raintank/gists{/gist_id}","starred_url":"https://api.github.com/users/raintank/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raintank/subscriptions","organizations_url":"https://api.github.com/users/raintank/orgs","repos_url":"https://api.github.com/users/raintank/repos","events_url":"https://api.github.com/users/raintank/events{/privacy}","received_events_url":"https://api.github.com/users/raintank/received_events","type":"Organization","site_admin":false},"repo":{"id":30401116,"name":"metrictank","full_name":"raintank/metrictank","owner":{"login":"raintank","id":8512431,"avatar_url":"https://avatars.githubusercontent.com/u/8512431?v=3","gravatar_id":"","url":"https://api.github.com/users/raintank","html_url":"https://github.com/raintank","followers_url":"https://api.github.com/users/raintank/followers","following_url":"https://api.github.com/users/raintank/following{/other_user}","gists_url":"https://api.github.com/users/raintank/gists{/gist_id}","starred_url":"https://api.github.com/users/raintank/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raintank/subscriptions","organizations_url":"https://api.github.com/users/raintank/orgs","repos_url":"https://api.github.com/users/raintank/repos","events_url":"https://api.github.com/users/raintank/events{/privacy}","received_events_url":"https://api.github.com/users/raintank/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/raintank/metrictank","description":"Cassandra-backed, metrics2.0 based, multi-tenant timeseries database for Graphite and friends","fork":false,"url":"https://api.github.com/repos/raintank/metrictank","forks_url":"https://api.github.com/repos/raintank/metrictank/forks","keys_url":"https://api.github.com/repos/raintank/metrictank/keys{/key_id}","collaborators_url":"https://api.github.com/repos/raintank/metrictank/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/raintank/metrictank/teams","hooks_url":"https://api.github.com/repos/raintank/metrictank/hooks","issue_events_url":"https://api.github.com/repos/raintank/metrictank/issues/events{/number}","events_url":"https://api.github.com/repos/raintank/metrictank/events","assignees_url":"https://api.github.com/repos/raintank/metrictank/assignees{/user}","branches_url":"https://api.github.com/repos/raintank/metrictank/branches{/branch}","tags_url":"https://api.github.com/repos/raintank/metrictank/tags","blobs_url":"https://api.github.com/repos/raintank/metrictank/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/raintank/metrictank/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/raintank/metrictank/git/refs{/sha}","trees_url":"https://api.github.com/repos/raintank/metrictank/git/trees{/sha}","statuses_url":"https://api.github.com/repos/raintank/metrictank/statuses/{sha}","languages_url":"https://api.github.com/repos/raintank/metrictank/languages","stargazers_url":"https://api.github.com/repos/raintank/metrictank/stargazers","contributors_url":"https://api.github.com/repos/raintank/metrictank/contributors","subscribers_url":"https://api.github.com/repos/raintank/metrictank/subscribers","subscription_url":"https://api.github.com/repos/raintank/metrictank/subscription","commits_url":"https://api.github.com/repos/raintank/metrictank/commits{/sha}","git_commits_url":"https://api.github.com/repos/raintank/metrictank/git/commits{/sha}","comments_url":"https://api.github.com/repos/raintank/metrictank/comments{/number}","issue_comment_url":"https://api.github.com/repos/raintank/metrictank/issues/comments{/number}","contents_url":"https://api.github.com/repos/raintank/metrictank/contents/{+path}","compare_url":"https://api.github.com/repos/raintank/metrictank/compare/{base}...{head}","merges_url":"https://api.github.com/repos/raintank/metrictank/merges","archive_url":"https://api.github.com/repos/raintank/metrictank/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/raintank/metrictank/downloads","issues_url":"https://api.github.com/repos/raintank/metrictank/issues{/number}","pulls_url":"https://api.github.com/repos/raintank/metrictank/pulls{/number}","milestones_url":"https://api.github.com/repos/raintank/metrictank/milestones{/number}","notifications_url":"https://api.github.com/repos/raintank/metrictank/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/raintank/metrictank/labels{/name}","releases_url":"https://api.github.com/repos/raintank/metrictank/releases{/id}","deployments_url":"https://api.github.com/repos/raintank/metrictank/deployments","created_at":"2015-02-06T07:44:12Z","updated_at":"2016-11-18T09:35:31Z","pushed_at":"2016-11-19T09:13:25Z","git_url":"git://github.com/raintank/metrictank.git","ssh_url":"git@github.com:raintank/metrictank.git","clone_url":"https://github.com/raintank/metrictank.git","svn_url":"https://github.com/raintank/metrictank","homepage":"","size":9432,"stargazers_count":75,"watchers_count":75,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":80,"forks":10,"open_issues":80,"watchers":75,"default_branch":"master"}},"base":{"label":"raintank:master","ref":"master","sha":"f08915d2cda26ef73835ac8da0246d5737d07c47","user":{"login":"raintank","id":8512431,"avatar_url":"https://avatars.githubusercontent.com/u/8512431?v=3","gravatar_id":"","url":"https://api.github.com/users/raintank","html_url":"https://github.com/raintank","followers_url":"https://api.github.com/users/raintank/followers","following_url":"https://api.github.com/users/raintank/following{/other_user}","gists_url":"https://api.github.com/users/raintank/gists{/gist_id}","starred_url":"https://api.github.com/users/raintank/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raintank/subscriptions","organizations_url":"https://api.github.com/users/raintank/orgs","repos_url":"https://api.github.com/users/raintank/repos","events_url":"https://api.github.com/users/raintank/events{/privacy}","received_events_url":"https://api.github.com/users/raintank/received_events","type":"Organization","site_admin":false},"repo":{"id":30401116,"name":"metrictank","full_name":"raintank/metrictank","owner":{"login":"raintank","id":8512431,"avatar_url":"https://avatars.githubusercontent.com/u/8512431?v=3","gravatar_id":"","url":"https://api.github.com/users/raintank","html_url":"https://github.com/raintank","followers_url":"https://api.github.com/users/raintank/followers","following_url":"https://api.github.com/users/raintank/following{/other_user}","gists_url":"https://api.github.com/users/raintank/gists{/gist_id}","starred_url":"https://api.github.com/users/raintank/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raintank/subscriptions","organizations_url":"https://api.github.com/users/raintank/orgs","repos_url":"https://api.github.com/users/raintank/repos","events_url":"https://api.github.com/users/raintank/events{/privacy}","received_events_url":"https://api.github.com/users/raintank/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/raintank/metrictank","description":"Cassandra-backed, metrics2.0 based, multi-tenant timeseries database for Graphite and friends","fork":false,"url":"https://api.github.com/repos/raintank/metrictank","forks_url":"https://api.github.com/repos/raintank/metrictank/forks","keys_url":"https://api.github.com/repos/raintank/metrictank/keys{/key_id}","collaborators_url":"https://api.github.com/repos/raintank/metrictank/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/raintank/metrictank/teams","hooks_url":"https://api.github.com/repos/raintank/metrictank/hooks","issue_events_url":"https://api.github.com/repos/raintank/metrictank/issues/events{/number}","events_url":"https://api.github.com/repos/raintank/metrictank/events","assignees_url":"https://api.github.com/repos/raintank/metrictank/assignees{/user}","branches_url":"https://api.github.com/repos/raintank/metrictank/branches{/branch}","tags_url":"https://api.github.com/repos/raintank/metrictank/tags","blobs_url":"https://api.github.com/repos/raintank/metrictank/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/raintank/metrictank/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/raintank/metrictank/git/refs{/sha}","trees_url":"https://api.github.com/repos/raintank/metrictank/git/trees{/sha}","statuses_url":"https://api.github.com/repos/raintank/metrictank/statuses/{sha}","languages_url":"https://api.github.com/repos/raintank/metrictank/languages","stargazers_url":"https://api.github.com/repos/raintank/metrictank/stargazers","contributors_url":"https://api.github.com/repos/raintank/metrictank/contributors","subscribers_url":"https://api.github.com/repos/raintank/metrictank/subscribers","subscription_url":"https://api.github.com/repos/raintank/metrictank/subscription","commits_url":"https://api.github.com/repos/raintank/metrictank/commits{/sha}","git_commits_url":"https://api.github.com/repos/raintank/metrictank/git/commits{/sha}","comments_url":"https://api.github.com/repos/raintank/metrictank/comments{/number}","issue_comment_url":"https://api.github.com/repos/raintank/metrictank/issues/comments{/number}","contents_url":"https://api.github.com/repos/raintank/metrictank/contents/{+path}","compare_url":"https://api.github.com/repos/raintank/metrictank/compare/{base}...{head}","merges_url":"https://api.github.com/repos/raintank/metrictank/merges","archive_url":"https://api.github.com/repos/raintank/metrictank/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/raintank/metrictank/downloads","issues_url":"https://api.github.com/repos/raintank/metrictank/issues{/number}","pulls_url":"https://api.github.com/repos/raintank/metrictank/pulls{/number}","milestones_url":"https://api.github.com/repos/raintank/metrictank/milestones{/number}","notifications_url":"https://api.github.com/repos/raintank/metrictank/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/raintank/metrictank/labels{/name}","releases_url":"https://api.github.com/repos/raintank/metrictank/releases{/id}","deployments_url":"https://api.github.com/repos/raintank/metrictank/deployments","created_at":"2015-02-06T07:44:12Z","updated_at":"2016-11-18T09:35:31Z","pushed_at":"2016-11-19T09:13:25Z","git_url":"git://github.com/raintank/metrictank.git","ssh_url":"git@github.com:raintank/metrictank.git","clone_url":"https://github.com/raintank/metrictank.git","svn_url":"https://github.com/raintank/metrictank","homepage":"","size":9432,"stargazers_count":75,"watchers_count":75,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":80,"forks":10,"open_issues":80,"watchers":75,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/raintank/metrictank/pulls/400"},"html":{"href":"https://github.com/raintank/metrictank/pull/400"},"issue":{"href":"https://api.github.com/repos/raintank/metrictank/issues/400"},"comments":{"href":"https://api.github.com/repos/raintank/metrictank/issues/400/comments"},"review_comments":{"href":"https://api.github.com/repos/raintank/metrictank/pulls/400/comments"},"review_comment":{"href":"https://api.github.com/repos/raintank/metrictank/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/raintank/metrictank/pulls/400/commits"},"statuses":{"href":"https://api.github.com/repos/raintank/metrictank/statuses/3dc473a2c72b7a6f9996bf823d4eef205c16208b"}}}}
{"actor":{"display_login":"woodsaj"}}