{"action":"created","comment":{"url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/pulls/comments/41721422","id":41721422,"diff_hunk":"@@ -22,6 +27,121 @@\n \tprivate static Map<String, Map<Long, LagScanner.Result>> cache = \r\n \t\t\tnew HashMap<String, Map<Long, LagScanner.Result>>();\r\n \r\n+\tprivate static Map<String, TreeMap<Long, HashSet<Long>>> worstChunksUnchecked = \r\n+\t\t\tnew HashMap<String, TreeMap<Long, HashSet<Long>>>();\r\n+\tprivate static Map<String, TreeMap<Long, Long>> worstChunksUncheckedIdx = \r\n+\t\t\tnew HashMap<String, TreeMap<Long, Long>>();\r\n+\tprivate static Map<String, TreeSet<Long>> worstChunksChecked = \r\n+\t\t\tnew HashMap<String, TreeSet<Long>>();\r\n+\r\n+\t/**\r\n+\t * Gets another chunk. Goes world by world from worst chunk to best in the world.\r\n+\t */\r\n+\tpublic static Location getNextBadChunk(MutableLong ml, boolean mark) {\r\n+\t\tsynchronized(worstChunksChecked) {\r\n+\t\t\tfor (String world : worstChunksUnchecked.keySet()) {\r\n+\t\t\t\tTreeMap<Long, HashSet<Long>> worldBad = worstChunksUnchecked.get(world);\r\n+\t\t\t\tif (worldBad != null && !worldBad.isEmpty()) {\r\n+\t\t\t\t\tfor (Long score : worldBad.descendingKeySet()) {\r\n+\t\t\t\t\t\tHashSet<Long> locations = worldBad.get(score);\r\n+\t\t\t\t\t\tif (locations != null && !locations.isEmpty()) {\r\n+\t\t\t\t\t\t\tLong location = locations.iterator().next();\r\n+\t\t\t\t\t\t\tlong chunkX = location >> 32L;\r","path":"src/com/github/Kraken3/AFKPGC/LagScanner.java","position":41,"original_position":41,"commit_id":"1aaf6fae050bc9c9b9b7243fcdde96538e0259ea","original_commit_id":"ab68f934e2630a9c541cb9be30db1286eeec7964","user":{"login":"ProgrammerDan","id":409230,"avatar_url":"https://avatars.githubusercontent.com/u/409230?v=3","gravatar_id":"","url":"https://api.github.com/users/ProgrammerDan","html_url":"https://github.com/ProgrammerDan","followers_url":"https://api.github.com/users/ProgrammerDan/followers","following_url":"https://api.github.com/users/ProgrammerDan/following{/other_user}","gists_url":"https://api.github.com/users/ProgrammerDan/gists{/gist_id}","starred_url":"https://api.github.com/users/ProgrammerDan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ProgrammerDan/subscriptions","organizations_url":"https://api.github.com/users/ProgrammerDan/orgs","repos_url":"https://api.github.com/users/ProgrammerDan/repos","events_url":"https://api.github.com/users/ProgrammerDan/events{/privacy}","received_events_url":"https://api.github.com/users/ProgrammerDan/received_events","type":"User","site_admin":false},"body":"I mean, it seemed to work perfectly in testing. Lemme look up the shifts and be sure I'm doing what I intend.","created_at":"2015-10-12T03:50:36Z","updated_at":"2015-10-12T03:50:36Z","html_url":"https://github.com/Civcraft/AFK-Player-GC/pull/28#discussion_r41721422","pull_request_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/pulls/28","_links":{"self":{"href":"https://api.github.com/repos/Civcraft/AFK-Player-GC/pulls/comments/41721422"},"html":{"href":"https://github.com/Civcraft/AFK-Player-GC/pull/28#discussion_r41721422"},"pull_request":{"href":"https://api.github.com/repos/Civcraft/AFK-Player-GC/pulls/28"}}},"pull_request":{"url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/pulls/28","id":47377271,"html_url":"https://github.com/Civcraft/AFK-Player-GC/pull/28","diff_url":"https://github.com/Civcraft/AFK-Player-GC/pull/28.diff","patch_url":"https://github.com/Civcraft/AFK-Player-GC/pull/28.patch","issue_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/issues/28","number":28,"state":"open","locked":false,"title":"Lag investigation tooling","user":{"login":"ProgrammerDan","id":409230,"avatar_url":"https://avatars.githubusercontent.com/u/409230?v=3","gravatar_id":"","url":"https://api.github.com/users/ProgrammerDan","html_url":"https://github.com/ProgrammerDan","followers_url":"https://api.github.com/users/ProgrammerDan/followers","following_url":"https://api.github.com/users/ProgrammerDan/following{/other_user}","gists_url":"https://api.github.com/users/ProgrammerDan/gists{/gist_id}","starred_url":"https://api.github.com/users/ProgrammerDan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ProgrammerDan/subscriptions","organizations_url":"https://api.github.com/users/ProgrammerDan/orgs","repos_url":"https://api.github.com/users/ProgrammerDan/repos","events_url":"https://api.github.com/users/ProgrammerDan/events{/privacy}","received_events_url":"https://api.github.com/users/ProgrammerDan/received_events","type":"User","site_admin":false},"body":"Admin (operator only) tool for investigating lag. Be sure to add your account to the immune account list in the config before using it. \r\n\r\nChunks investigated are marked, so future invocations of ```/afkpgc inv``` won't take you to the same place. Multiple investigators can work side by side, additional invocations of /afkpgc inv will always take you to the next worst location.\r\n\r\nChunks stored are cleared every server restart.\r\n\r\nMight need to add an ability to clear or turn off this feature. When you put it online, keep an eye on the server that day.\r\n\r\nShould make investigating lag sources far easier, it'll take you to anything that crosses the \"acceptable\" boundary at a per-chunk level, so even \"low burn\" bad sources will show up.","created_at":"2015-10-11T22:39:32Z","updated_at":"2015-10-12T03:50:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"093a0d74190067b60e2ca69aee25d6fd1b4b3094","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/pulls/28/commits","review_comments_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/pulls/28/comments","review_comment_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/issues/28/comments","statuses_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/statuses/1aaf6fae050bc9c9b9b7243fcdde96538e0259ea","head":{"label":"Civcraft:laginvestigate","ref":"laginvestigate","sha":"1aaf6fae050bc9c9b9b7243fcdde96538e0259ea","user":{"login":"Civcraft","id":3921874,"avatar_url":"https://avatars.githubusercontent.com/u/3921874?v=3","gravatar_id":"","url":"https://api.github.com/users/Civcraft","html_url":"https://github.com/Civcraft","followers_url":"https://api.github.com/users/Civcraft/followers","following_url":"https://api.github.com/users/Civcraft/following{/other_user}","gists_url":"https://api.github.com/users/Civcraft/gists{/gist_id}","starred_url":"https://api.github.com/users/Civcraft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Civcraft/subscriptions","organizations_url":"https://api.github.com/users/Civcraft/orgs","repos_url":"https://api.github.com/users/Civcraft/repos","events_url":"https://api.github.com/users/Civcraft/events{/privacy}","received_events_url":"https://api.github.com/users/Civcraft/received_events","type":"Organization","site_admin":false},"repo":{"id":8911996,"name":"AFK-Player-GC","full_name":"Civcraft/AFK-Player-GC","owner":{"login":"Civcraft","id":3921874,"avatar_url":"https://avatars.githubusercontent.com/u/3921874?v=3","gravatar_id":"","url":"https://api.github.com/users/Civcraft","html_url":"https://github.com/Civcraft","followers_url":"https://api.github.com/users/Civcraft/followers","following_url":"https://api.github.com/users/Civcraft/following{/other_user}","gists_url":"https://api.github.com/users/Civcraft/gists{/gist_id}","starred_url":"https://api.github.com/users/Civcraft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Civcraft/subscriptions","organizations_url":"https://api.github.com/users/Civcraft/orgs","repos_url":"https://api.github.com/users/Civcraft/repos","events_url":"https://api.github.com/users/Civcraft/events{/privacy}","received_events_url":"https://api.github.com/users/Civcraft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Civcraft/AFK-Player-GC","description":"AFK Player Garbage Collector","fork":true,"url":"https://api.github.com/repos/Civcraft/AFK-Player-GC","forks_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/forks","keys_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/teams","hooks_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/hooks","issue_events_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/issues/events{/number}","events_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/events","assignees_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/assignees{/user}","branches_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/branches{/branch}","tags_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/tags","blobs_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/git/refs{/sha}","trees_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/statuses/{sha}","languages_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/languages","stargazers_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/stargazers","contributors_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/contributors","subscribers_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/subscribers","subscription_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/subscription","commits_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/commits{/sha}","git_commits_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/git/commits{/sha}","comments_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/comments{/number}","issue_comment_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/issues/comments{/number}","contents_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/contents/{+path}","compare_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/merges","archive_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/downloads","issues_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/issues{/number}","pulls_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/pulls{/number}","milestones_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/milestones{/number}","notifications_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/labels{/name}","releases_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/releases{/id}","created_at":"2013-03-20T19:00:21Z","updated_at":"2015-03-08T20:31:03Z","pushed_at":"2015-10-12T03:49:53Z","git_url":"git://github.com/Civcraft/AFK-Player-GC.git","ssh_url":"git@github.com:Civcraft/AFK-Player-GC.git","clone_url":"https://github.com/Civcraft/AFK-Player-GC.git","svn_url":"https://github.com/Civcraft/AFK-Player-GC","homepage":null,"size":14707,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":4,"forks":3,"open_issues":4,"watchers":0,"default_branch":"master"}},"base":{"label":"Civcraft:master","ref":"master","sha":"7855b513e9cd8dbe7a604a984aec0d070c3dab83","user":{"login":"Civcraft","id":3921874,"avatar_url":"https://avatars.githubusercontent.com/u/3921874?v=3","gravatar_id":"","url":"https://api.github.com/users/Civcraft","html_url":"https://github.com/Civcraft","followers_url":"https://api.github.com/users/Civcraft/followers","following_url":"https://api.github.com/users/Civcraft/following{/other_user}","gists_url":"https://api.github.com/users/Civcraft/gists{/gist_id}","starred_url":"https://api.github.com/users/Civcraft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Civcraft/subscriptions","organizations_url":"https://api.github.com/users/Civcraft/orgs","repos_url":"https://api.github.com/users/Civcraft/repos","events_url":"https://api.github.com/users/Civcraft/events{/privacy}","received_events_url":"https://api.github.com/users/Civcraft/received_events","type":"Organization","site_admin":false},"repo":{"id":8911996,"name":"AFK-Player-GC","full_name":"Civcraft/AFK-Player-GC","owner":{"login":"Civcraft","id":3921874,"avatar_url":"https://avatars.githubusercontent.com/u/3921874?v=3","gravatar_id":"","url":"https://api.github.com/users/Civcraft","html_url":"https://github.com/Civcraft","followers_url":"https://api.github.com/users/Civcraft/followers","following_url":"https://api.github.com/users/Civcraft/following{/other_user}","gists_url":"https://api.github.com/users/Civcraft/gists{/gist_id}","starred_url":"https://api.github.com/users/Civcraft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Civcraft/subscriptions","organizations_url":"https://api.github.com/users/Civcraft/orgs","repos_url":"https://api.github.com/users/Civcraft/repos","events_url":"https://api.github.com/users/Civcraft/events{/privacy}","received_events_url":"https://api.github.com/users/Civcraft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Civcraft/AFK-Player-GC","description":"AFK Player Garbage Collector","fork":true,"url":"https://api.github.com/repos/Civcraft/AFK-Player-GC","forks_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/forks","keys_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/teams","hooks_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/hooks","issue_events_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/issues/events{/number}","events_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/events","assignees_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/assignees{/user}","branches_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/branches{/branch}","tags_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/tags","blobs_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/git/refs{/sha}","trees_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/statuses/{sha}","languages_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/languages","stargazers_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/stargazers","contributors_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/contributors","subscribers_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/subscribers","subscription_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/subscription","commits_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/commits{/sha}","git_commits_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/git/commits{/sha}","comments_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/comments{/number}","issue_comment_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/issues/comments{/number}","contents_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/contents/{+path}","compare_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/merges","archive_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/downloads","issues_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/issues{/number}","pulls_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/pulls{/number}","milestones_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/milestones{/number}","notifications_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/labels{/name}","releases_url":"https://api.github.com/repos/Civcraft/AFK-Player-GC/releases{/id}","created_at":"2013-03-20T19:00:21Z","updated_at":"2015-03-08T20:31:03Z","pushed_at":"2015-10-12T03:49:53Z","git_url":"git://github.com/Civcraft/AFK-Player-GC.git","ssh_url":"git@github.com:Civcraft/AFK-Player-GC.git","clone_url":"https://github.com/Civcraft/AFK-Player-GC.git","svn_url":"https://github.com/Civcraft/AFK-Player-GC","homepage":null,"size":14707,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":4,"forks":3,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Civcraft/AFK-Player-GC/pulls/28"},"html":{"href":"https://github.com/Civcraft/AFK-Player-GC/pull/28"},"issue":{"href":"https://api.github.com/repos/Civcraft/AFK-Player-GC/issues/28"},"comments":{"href":"https://api.github.com/repos/Civcraft/AFK-Player-GC/issues/28/comments"},"review_comments":{"href":"https://api.github.com/repos/Civcraft/AFK-Player-GC/pulls/28/comments"},"review_comment":{"href":"https://api.github.com/repos/Civcraft/AFK-Player-GC/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Civcraft/AFK-Player-GC/pulls/28/commits"},"statuses":{"href":"https://api.github.com/repos/Civcraft/AFK-Player-GC/statuses/1aaf6fae050bc9c9b9b7243fcdde96538e0259ea"}}}}