{"action":"created","comment":{"url":"https://api.github.com/repos/uber/tchannel-python/pulls/comments/46894510","id":46894510,"diff_hunk":"@@ -31,11 +33,26 @@ class PeerHeap(HeapOperation):\n \n     def __init__(self):\n         self.peers = []\n+        self.order = 0\n \n     def size(self):\n         return len(self.peers)\n \n     def lt(self, i, j):\n+        \"\"\"Compare the priority of two peers.\n+\n+        Primary comparator will be the score of each peer. If the score is\n+        same then use FIFO policy. The ``order`` attribute of the peer tracks\n+        the heap push order of the peer. This help solve the imbalance\n+        problem caused by randomization when deal with same score situation.","path":"tchannel/peer_heap.py","position":24,"original_position":24,"commit_id":"2c7cdd9e833effb1bb67c58f39833590e1aea7f5","original_commit_id":"2c7cdd9e833effb1bb67c58f39833590e1aea7f5","user":{"login":"abhinav","id":41730,"avatar_url":"https://avatars.githubusercontent.com/u/41730?v=3","gravatar_id":"","url":"https://api.github.com/users/abhinav","html_url":"https://github.com/abhinav","followers_url":"https://api.github.com/users/abhinav/followers","following_url":"https://api.github.com/users/abhinav/following{/other_user}","gists_url":"https://api.github.com/users/abhinav/gists{/gist_id}","starred_url":"https://api.github.com/users/abhinav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abhinav/subscriptions","organizations_url":"https://api.github.com/users/abhinav/orgs","repos_url":"https://api.github.com/users/abhinav/repos","events_url":"https://api.github.com/users/abhinav/events{/privacy}","received_events_url":"https://api.github.com/users/abhinav/received_events","type":"User","site_admin":false},"body":"Good work on adding the documentation but the information on the specifics of how the peer heap behaves should be in the class doc, not individual method docs.","created_at":"2015-12-07T23:26:42Z","updated_at":"2015-12-07T23:26:42Z","html_url":"https://github.com/uber/tchannel-python/pull/327#discussion_r46894510","pull_request_url":"https://api.github.com/repos/uber/tchannel-python/pulls/327","_links":{"self":{"href":"https://api.github.com/repos/uber/tchannel-python/pulls/comments/46894510"},"html":{"href":"https://github.com/uber/tchannel-python/pull/327#discussion_r46894510"},"pull_request":{"href":"https://api.github.com/repos/uber/tchannel-python/pulls/327"}}},"pull_request":{"url":"https://api.github.com/repos/uber/tchannel-python/pulls/327","id":52884787,"html_url":"https://github.com/uber/tchannel-python/pull/327","diff_url":"https://github.com/uber/tchannel-python/pull/327.diff","patch_url":"https://github.com/uber/tchannel-python/pull/327.patch","issue_url":"https://api.github.com/repos/uber/tchannel-python/issues/327","number":327,"state":"open","locked":false,"title":"Add peer score update event","user":{"login":"junchaowu","id":3731781,"avatar_url":"https://avatars.githubusercontent.com/u/3731781?v=3","gravatar_id":"","url":"https://api.github.com/users/junchaowu","html_url":"https://github.com/junchaowu","followers_url":"https://api.github.com/users/junchaowu/followers","following_url":"https://api.github.com/users/junchaowu/following{/other_user}","gists_url":"https://api.github.com/users/junchaowu/gists{/gist_id}","starred_url":"https://api.github.com/users/junchaowu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/junchaowu/subscriptions","organizations_url":"https://api.github.com/users/junchaowu/orgs","repos_url":"https://api.github.com/users/junchaowu/repos","events_url":"https://api.github.com/users/junchaowu/events{/privacy}","received_events_url":"https://api.github.com/users/junchaowu/received_events","type":"User","site_admin":false},"body":"@breerly @abhinav @blampe ","created_at":"2015-12-07T18:53:03Z","updated_at":"2015-12-07T23:26:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a520d4d9dd455cb17228fa5138e5be7c327438e5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/uber/tchannel-python/pulls/327/commits","review_comments_url":"https://api.github.com/repos/uber/tchannel-python/pulls/327/comments","review_comment_url":"https://api.github.com/repos/uber/tchannel-python/pulls/comments{/number}","comments_url":"https://api.github.com/repos/uber/tchannel-python/issues/327/comments","statuses_url":"https://api.github.com/repos/uber/tchannel-python/statuses/2c7cdd9e833effb1bb67c58f39833590e1aea7f5","head":{"label":"uber:heap","ref":"heap","sha":"2c7cdd9e833effb1bb67c58f39833590e1aea7f5","user":{"login":"uber","id":538264,"avatar_url":"https://avatars.githubusercontent.com/u/538264?v=3","gravatar_id":"","url":"https://api.github.com/users/uber","html_url":"https://github.com/uber","followers_url":"https://api.github.com/users/uber/followers","following_url":"https://api.github.com/users/uber/following{/other_user}","gists_url":"https://api.github.com/users/uber/gists{/gist_id}","starred_url":"https://api.github.com/users/uber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber/subscriptions","organizations_url":"https://api.github.com/users/uber/orgs","repos_url":"https://api.github.com/users/uber/repos","events_url":"https://api.github.com/users/uber/events{/privacy}","received_events_url":"https://api.github.com/users/uber/received_events","type":"Organization","site_admin":false},"repo":{"id":38906603,"name":"tchannel-python","full_name":"uber/tchannel-python","owner":{"login":"uber","id":538264,"avatar_url":"https://avatars.githubusercontent.com/u/538264?v=3","gravatar_id":"","url":"https://api.github.com/users/uber","html_url":"https://github.com/uber","followers_url":"https://api.github.com/users/uber/followers","following_url":"https://api.github.com/users/uber/following{/other_user}","gists_url":"https://api.github.com/users/uber/gists{/gist_id}","starred_url":"https://api.github.com/users/uber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber/subscriptions","organizations_url":"https://api.github.com/users/uber/orgs","repos_url":"https://api.github.com/users/uber/repos","events_url":"https://api.github.com/users/uber/events{/privacy}","received_events_url":"https://api.github.com/users/uber/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/uber/tchannel-python","description":"Python implementation of the TChannel protocol.","fork":false,"url":"https://api.github.com/repos/uber/tchannel-python","forks_url":"https://api.github.com/repos/uber/tchannel-python/forks","keys_url":"https://api.github.com/repos/uber/tchannel-python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uber/tchannel-python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uber/tchannel-python/teams","hooks_url":"https://api.github.com/repos/uber/tchannel-python/hooks","issue_events_url":"https://api.github.com/repos/uber/tchannel-python/issues/events{/number}","events_url":"https://api.github.com/repos/uber/tchannel-python/events","assignees_url":"https://api.github.com/repos/uber/tchannel-python/assignees{/user}","branches_url":"https://api.github.com/repos/uber/tchannel-python/branches{/branch}","tags_url":"https://api.github.com/repos/uber/tchannel-python/tags","blobs_url":"https://api.github.com/repos/uber/tchannel-python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uber/tchannel-python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uber/tchannel-python/git/refs{/sha}","trees_url":"https://api.github.com/repos/uber/tchannel-python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uber/tchannel-python/statuses/{sha}","languages_url":"https://api.github.com/repos/uber/tchannel-python/languages","stargazers_url":"https://api.github.com/repos/uber/tchannel-python/stargazers","contributors_url":"https://api.github.com/repos/uber/tchannel-python/contributors","subscribers_url":"https://api.github.com/repos/uber/tchannel-python/subscribers","subscription_url":"https://api.github.com/repos/uber/tchannel-python/subscription","commits_url":"https://api.github.com/repos/uber/tchannel-python/commits{/sha}","git_commits_url":"https://api.github.com/repos/uber/tchannel-python/git/commits{/sha}","comments_url":"https://api.github.com/repos/uber/tchannel-python/comments{/number}","issue_comment_url":"https://api.github.com/repos/uber/tchannel-python/issues/comments{/number}","contents_url":"https://api.github.com/repos/uber/tchannel-python/contents/{+path}","compare_url":"https://api.github.com/repos/uber/tchannel-python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uber/tchannel-python/merges","archive_url":"https://api.github.com/repos/uber/tchannel-python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uber/tchannel-python/downloads","issues_url":"https://api.github.com/repos/uber/tchannel-python/issues{/number}","pulls_url":"https://api.github.com/repos/uber/tchannel-python/pulls{/number}","milestones_url":"https://api.github.com/repos/uber/tchannel-python/milestones{/number}","notifications_url":"https://api.github.com/repos/uber/tchannel-python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uber/tchannel-python/labels{/name}","releases_url":"https://api.github.com/repos/uber/tchannel-python/releases{/id}","created_at":"2015-07-10T23:35:17Z","updated_at":"2015-11-24T20:29:46Z","pushed_at":"2015-12-07T22:51:08Z","git_url":"git://github.com/uber/tchannel-python.git","ssh_url":"git@github.com:uber/tchannel-python.git","clone_url":"https://github.com/uber/tchannel-python.git","svn_url":"https://github.com/uber/tchannel-python","homepage":null,"size":1872,"stargazers_count":29,"watchers_count":29,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":49,"forks":8,"open_issues":49,"watchers":29,"default_branch":"master"}},"base":{"label":"uber:peerheap","ref":"peerheap","sha":"790b33fad3a98cd33482f567441ed50fb924780c","user":{"login":"uber","id":538264,"avatar_url":"https://avatars.githubusercontent.com/u/538264?v=3","gravatar_id":"","url":"https://api.github.com/users/uber","html_url":"https://github.com/uber","followers_url":"https://api.github.com/users/uber/followers","following_url":"https://api.github.com/users/uber/following{/other_user}","gists_url":"https://api.github.com/users/uber/gists{/gist_id}","starred_url":"https://api.github.com/users/uber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber/subscriptions","organizations_url":"https://api.github.com/users/uber/orgs","repos_url":"https://api.github.com/users/uber/repos","events_url":"https://api.github.com/users/uber/events{/privacy}","received_events_url":"https://api.github.com/users/uber/received_events","type":"Organization","site_admin":false},"repo":{"id":38906603,"name":"tchannel-python","full_name":"uber/tchannel-python","owner":{"login":"uber","id":538264,"avatar_url":"https://avatars.githubusercontent.com/u/538264?v=3","gravatar_id":"","url":"https://api.github.com/users/uber","html_url":"https://github.com/uber","followers_url":"https://api.github.com/users/uber/followers","following_url":"https://api.github.com/users/uber/following{/other_user}","gists_url":"https://api.github.com/users/uber/gists{/gist_id}","starred_url":"https://api.github.com/users/uber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber/subscriptions","organizations_url":"https://api.github.com/users/uber/orgs","repos_url":"https://api.github.com/users/uber/repos","events_url":"https://api.github.com/users/uber/events{/privacy}","received_events_url":"https://api.github.com/users/uber/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/uber/tchannel-python","description":"Python implementation of the TChannel protocol.","fork":false,"url":"https://api.github.com/repos/uber/tchannel-python","forks_url":"https://api.github.com/repos/uber/tchannel-python/forks","keys_url":"https://api.github.com/repos/uber/tchannel-python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uber/tchannel-python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uber/tchannel-python/teams","hooks_url":"https://api.github.com/repos/uber/tchannel-python/hooks","issue_events_url":"https://api.github.com/repos/uber/tchannel-python/issues/events{/number}","events_url":"https://api.github.com/repos/uber/tchannel-python/events","assignees_url":"https://api.github.com/repos/uber/tchannel-python/assignees{/user}","branches_url":"https://api.github.com/repos/uber/tchannel-python/branches{/branch}","tags_url":"https://api.github.com/repos/uber/tchannel-python/tags","blobs_url":"https://api.github.com/repos/uber/tchannel-python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uber/tchannel-python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uber/tchannel-python/git/refs{/sha}","trees_url":"https://api.github.com/repos/uber/tchannel-python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uber/tchannel-python/statuses/{sha}","languages_url":"https://api.github.com/repos/uber/tchannel-python/languages","stargazers_url":"https://api.github.com/repos/uber/tchannel-python/stargazers","contributors_url":"https://api.github.com/repos/uber/tchannel-python/contributors","subscribers_url":"https://api.github.com/repos/uber/tchannel-python/subscribers","subscription_url":"https://api.github.com/repos/uber/tchannel-python/subscription","commits_url":"https://api.github.com/repos/uber/tchannel-python/commits{/sha}","git_commits_url":"https://api.github.com/repos/uber/tchannel-python/git/commits{/sha}","comments_url":"https://api.github.com/repos/uber/tchannel-python/comments{/number}","issue_comment_url":"https://api.github.com/repos/uber/tchannel-python/issues/comments{/number}","contents_url":"https://api.github.com/repos/uber/tchannel-python/contents/{+path}","compare_url":"https://api.github.com/repos/uber/tchannel-python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uber/tchannel-python/merges","archive_url":"https://api.github.com/repos/uber/tchannel-python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uber/tchannel-python/downloads","issues_url":"https://api.github.com/repos/uber/tchannel-python/issues{/number}","pulls_url":"https://api.github.com/repos/uber/tchannel-python/pulls{/number}","milestones_url":"https://api.github.com/repos/uber/tchannel-python/milestones{/number}","notifications_url":"https://api.github.com/repos/uber/tchannel-python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uber/tchannel-python/labels{/name}","releases_url":"https://api.github.com/repos/uber/tchannel-python/releases{/id}","created_at":"2015-07-10T23:35:17Z","updated_at":"2015-11-24T20:29:46Z","pushed_at":"2015-12-07T22:51:08Z","git_url":"git://github.com/uber/tchannel-python.git","ssh_url":"git@github.com:uber/tchannel-python.git","clone_url":"https://github.com/uber/tchannel-python.git","svn_url":"https://github.com/uber/tchannel-python","homepage":null,"size":1872,"stargazers_count":29,"watchers_count":29,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":49,"forks":8,"open_issues":49,"watchers":29,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/uber/tchannel-python/pulls/327"},"html":{"href":"https://github.com/uber/tchannel-python/pull/327"},"issue":{"href":"https://api.github.com/repos/uber/tchannel-python/issues/327"},"comments":{"href":"https://api.github.com/repos/uber/tchannel-python/issues/327/comments"},"review_comments":{"href":"https://api.github.com/repos/uber/tchannel-python/pulls/327/comments"},"review_comment":{"href":"https://api.github.com/repos/uber/tchannel-python/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/uber/tchannel-python/pulls/327/commits"},"statuses":{"href":"https://api.github.com/repos/uber/tchannel-python/statuses/2c7cdd9e833effb1bb67c58f39833590e1aea7f5"}}}}