{"action":"created","comment":{"url":"https://api.github.com/repos/Flipkart/fk-prof/pulls/comments/96398085","pull_request_review_id":16963882,"id":96398085,"diff_hunk":"@@ -0,0 +1,49 @@\n+package fk.prof.aggregation;\n+\n+import com.koloboke.collect.map.hash.HashLongObjMaps;\n+\n+import java.util.Collections;\n+import java.util.Map;\n+import java.util.concurrent.ConcurrentHashMap;\n+import java.util.concurrent.atomic.AtomicLong;\n+\n+public class MethodIdLookup {\n+  //-2 is reserved for placeholder global root method of all stack-trace\n+  public final static long GLOBAL_ROOT_METHOD_ID = -2l;\n+  public final static String GLOBAL_ROOT_METHOD_SIGNATURE = \"~ ROOT ~.()\";\n+  //-1 is reserved for placeholder unclassifiable roor method of all incomplete stack-traces\n+  public final static long UNCLASSIFIABLE_ROOT_METHOD_ID = -1l;\n+  public final static String UNCLASSIFIABLE_ROOT_METHOD_SIGNATURE = \"~ UNCLASSIFIABLE ~.()\";\n+\n+  //Counter to generate method ids in auto increment fashion\n+  //0 is reserved. No method is assigned 0. Counter starts with 1 during assignment\n+  private AtomicLong counter = new AtomicLong(0);\n+  private ConcurrentHashMap<String, Long> lookup = new ConcurrentHashMap<>();\n+\n+  public MethodIdLookup() {\n+    lookup.put(GLOBAL_ROOT_METHOD_SIGNATURE, GLOBAL_ROOT_METHOD_ID);\n+    lookup.put(UNCLASSIFIABLE_ROOT_METHOD_SIGNATURE, UNCLASSIFIABLE_ROOT_METHOD_ID);\n+  }\n+\n+  public Long getOrAdd(String methodSignature) {\n+    return lookup.computeIfAbsent(methodSignature, (key -> counter.incrementAndGet()));\n+  }\n+\n+  /**\n+   * Generates a reverse lookup map (unmodifiable view) from methodId to method name\n+   * Usually a reverse lookup is modelled as Map[V, List[K]] but because the put semantics in this map using atomic long counter,\n+   * we are assured of a 1:1 relationship between K and V. Therefore, reverse lookup is modelled as Map[V, K]\n+   *\n+   * @return lookup from methodId - method name\n+   */\n+  public Map<Long, String> generateReverseLookup() {","path":"aggregation/src/main/java/fk/prof/aggregation/MethodIdLookup.java","position":39,"original_position":39,"commit_id":"7295ef526a2b4211308b0b874c5e656abb28f17f","original_commit_id":"7295ef526a2b4211308b0b874c5e656abb28f17f","user":{"login":"gauravAshok","id":10920448,"avatar_url":"https://avatars.githubusercontent.com/u/10920448?v=3","gravatar_id":"","url":"https://api.github.com/users/gauravAshok","html_url":"https://github.com/gauravAshok","followers_url":"https://api.github.com/users/gauravAshok/followers","following_url":"https://api.github.com/users/gauravAshok/following{/other_user}","gists_url":"https://api.github.com/users/gauravAshok/gists{/gist_id}","starred_url":"https://api.github.com/users/gauravAshok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gauravAshok/subscriptions","organizations_url":"https://api.github.com/users/gauravAshok/orgs","repos_url":"https://api.github.com/users/gauravAshok/repos","events_url":"https://api.github.com/users/gauravAshok/events{/privacy}","received_events_url":"https://api.github.com/users/gauravAshok/received_events","type":"User","site_admin":false},"body":"We can here return an array instead of Map. Since we are assigning all numbers upto some N, we can have array[map.get(methodid) + 2] = methodid","created_at":"2017-01-17T12:11:09Z","updated_at":"2017-01-17T12:21:42Z","html_url":"https://github.com/Flipkart/fk-prof/pull/4#discussion_r96398085","pull_request_url":"https://api.github.com/repos/Flipkart/fk-prof/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/Flipkart/fk-prof/pulls/comments/96398085"},"html":{"href":"https://github.com/Flipkart/fk-prof/pull/4#discussion_r96398085"},"pull_request":{"href":"https://api.github.com/repos/Flipkart/fk-prof/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/Flipkart/fk-prof/pulls/4","id":100339350,"html_url":"https://github.com/Flipkart/fk-prof/pull/4","diff_url":"https://github.com/Flipkart/fk-prof/pull/4.diff","patch_url":"https://github.com/Flipkart/fk-prof/pull/4.patch","issue_url":"https://api.github.com/repos/Flipkart/fk-prof/issues/4","number":4,"state":"open","locked":false,"title":"Aggregator module and profile API","user":{"login":"fk-ajain","id":8705790,"avatar_url":"https://avatars.githubusercontent.com/u/8705790?v=3","gravatar_id":"","url":"https://api.github.com/users/fk-ajain","html_url":"https://github.com/fk-ajain","followers_url":"https://api.github.com/users/fk-ajain/followers","following_url":"https://api.github.com/users/fk-ajain/following{/other_user}","gists_url":"https://api.github.com/users/fk-ajain/gists{/gist_id}","starred_url":"https://api.github.com/users/fk-ajain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fk-ajain/subscriptions","organizations_url":"https://api.github.com/users/fk-ajain/orgs","repos_url":"https://api.github.com/users/fk-ajain/repos","events_url":"https://api.github.com/users/fk-ajain/events{/privacy}","received_events_url":"https://api.github.com/users/fk-ajain/received_events","type":"User","site_admin":false},"body":"1. Classes for representing aggregated profile on-heap (Note: This includes classes in aggregation module which have been present in an earlier PR as well but they are slightly revised in this PR and have unit tests)\r\n2. Vertx bootstrap with integration of dropwizard metrics, loading configuration from config.json, log4j and vertx logger setup and deployment of vertx application\r\n3. Http verticle setup for rest api: /profile\r\n4. Parser for profile data\r\n5. Aggregation module for merging raw profile data in aggregation window","created_at":"2017-01-05T18:26:57Z","updated_at":"2017-01-17T12:21:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"eab7d02c0065716d854aad3e8fc2f4a44db67d5a","assignee":{"login":"fk-ajain","id":8705790,"avatar_url":"https://avatars.githubusercontent.com/u/8705790?v=3","gravatar_id":"","url":"https://api.github.com/users/fk-ajain","html_url":"https://github.com/fk-ajain","followers_url":"https://api.github.com/users/fk-ajain/followers","following_url":"https://api.github.com/users/fk-ajain/following{/other_user}","gists_url":"https://api.github.com/users/fk-ajain/gists{/gist_id}","starred_url":"https://api.github.com/users/fk-ajain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fk-ajain/subscriptions","organizations_url":"https://api.github.com/users/fk-ajain/orgs","repos_url":"https://api.github.com/users/fk-ajain/repos","events_url":"https://api.github.com/users/fk-ajain/events{/privacy}","received_events_url":"https://api.github.com/users/fk-ajain/received_events","type":"User","site_admin":false},"assignees":[{"login":"fk-ajain","id":8705790,"avatar_url":"https://avatars.githubusercontent.com/u/8705790?v=3","gravatar_id":"","url":"https://api.github.com/users/fk-ajain","html_url":"https://github.com/fk-ajain","followers_url":"https://api.github.com/users/fk-ajain/followers","following_url":"https://api.github.com/users/fk-ajain/following{/other_user}","gists_url":"https://api.github.com/users/fk-ajain/gists{/gist_id}","starred_url":"https://api.github.com/users/fk-ajain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fk-ajain/subscriptions","organizations_url":"https://api.github.com/users/fk-ajain/orgs","repos_url":"https://api.github.com/users/fk-ajain/repos","events_url":"https://api.github.com/users/fk-ajain/events{/privacy}","received_events_url":"https://api.github.com/users/fk-ajain/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/Flipkart/fk-prof/pulls/4/commits","review_comments_url":"https://api.github.com/repos/Flipkart/fk-prof/pulls/4/comments","review_comment_url":"https://api.github.com/repos/Flipkart/fk-prof/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Flipkart/fk-prof/issues/4/comments","statuses_url":"https://api.github.com/repos/Flipkart/fk-prof/statuses/7295ef526a2b4211308b0b874c5e656abb28f17f","head":{"label":"Flipkart:aggregator","ref":"aggregator","sha":"7295ef526a2b4211308b0b874c5e656abb28f17f","user":{"login":"Flipkart","id":1179997,"avatar_url":"https://avatars.githubusercontent.com/u/1179997?v=3","gravatar_id":"","url":"https://api.github.com/users/Flipkart","html_url":"https://github.com/Flipkart","followers_url":"https://api.github.com/users/Flipkart/followers","following_url":"https://api.github.com/users/Flipkart/following{/other_user}","gists_url":"https://api.github.com/users/Flipkart/gists{/gist_id}","starred_url":"https://api.github.com/users/Flipkart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Flipkart/subscriptions","organizations_url":"https://api.github.com/users/Flipkart/orgs","repos_url":"https://api.github.com/users/Flipkart/repos","events_url":"https://api.github.com/users/Flipkart/events{/privacy}","received_events_url":"https://api.github.com/users/Flipkart/received_events","type":"Organization","site_admin":false},"repo":{"id":76980811,"name":"fk-prof","full_name":"Flipkart/fk-prof","owner":{"login":"Flipkart","id":1179997,"avatar_url":"https://avatars.githubusercontent.com/u/1179997?v=3","gravatar_id":"","url":"https://api.github.com/users/Flipkart","html_url":"https://github.com/Flipkart","followers_url":"https://api.github.com/users/Flipkart/followers","following_url":"https://api.github.com/users/Flipkart/following{/other_user}","gists_url":"https://api.github.com/users/Flipkart/gists{/gist_id}","starred_url":"https://api.github.com/users/Flipkart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Flipkart/subscriptions","organizations_url":"https://api.github.com/users/Flipkart/orgs","repos_url":"https://api.github.com/users/Flipkart/repos","events_url":"https://api.github.com/users/Flipkart/events{/privacy}","received_events_url":"https://api.github.com/users/Flipkart/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Flipkart/fk-prof","description":"A functional-context aware java-performance-profiler (based on https://github.com/RichardWarburton/honest-profiler/wiki)","fork":true,"url":"https://api.github.com/repos/Flipkart/fk-prof","forks_url":"https://api.github.com/repos/Flipkart/fk-prof/forks","keys_url":"https://api.github.com/repos/Flipkart/fk-prof/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Flipkart/fk-prof/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Flipkart/fk-prof/teams","hooks_url":"https://api.github.com/repos/Flipkart/fk-prof/hooks","issue_events_url":"https://api.github.com/repos/Flipkart/fk-prof/issues/events{/number}","events_url":"https://api.github.com/repos/Flipkart/fk-prof/events","assignees_url":"https://api.github.com/repos/Flipkart/fk-prof/assignees{/user}","branches_url":"https://api.github.com/repos/Flipkart/fk-prof/branches{/branch}","tags_url":"https://api.github.com/repos/Flipkart/fk-prof/tags","blobs_url":"https://api.github.com/repos/Flipkart/fk-prof/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Flipkart/fk-prof/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Flipkart/fk-prof/git/refs{/sha}","trees_url":"https://api.github.com/repos/Flipkart/fk-prof/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Flipkart/fk-prof/statuses/{sha}","languages_url":"https://api.github.com/repos/Flipkart/fk-prof/languages","stargazers_url":"https://api.github.com/repos/Flipkart/fk-prof/stargazers","contributors_url":"https://api.github.com/repos/Flipkart/fk-prof/contributors","subscribers_url":"https://api.github.com/repos/Flipkart/fk-prof/subscribers","subscription_url":"https://api.github.com/repos/Flipkart/fk-prof/subscription","commits_url":"https://api.github.com/repos/Flipkart/fk-prof/commits{/sha}","git_commits_url":"https://api.github.com/repos/Flipkart/fk-prof/git/commits{/sha}","comments_url":"https://api.github.com/repos/Flipkart/fk-prof/comments{/number}","issue_comment_url":"https://api.github.com/repos/Flipkart/fk-prof/issues/comments{/number}","contents_url":"https://api.github.com/repos/Flipkart/fk-prof/contents/{+path}","compare_url":"https://api.github.com/repos/Flipkart/fk-prof/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Flipkart/fk-prof/merges","archive_url":"https://api.github.com/repos/Flipkart/fk-prof/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Flipkart/fk-prof/downloads","issues_url":"https://api.github.com/repos/Flipkart/fk-prof/issues{/number}","pulls_url":"https://api.github.com/repos/Flipkart/fk-prof/pulls{/number}","milestones_url":"https://api.github.com/repos/Flipkart/fk-prof/milestones{/number}","notifications_url":"https://api.github.com/repos/Flipkart/fk-prof/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Flipkart/fk-prof/labels{/name}","releases_url":"https://api.github.com/repos/Flipkart/fk-prof/releases{/id}","deployments_url":"https://api.github.com/repos/Flipkart/fk-prof/deployments","created_at":"2016-12-20T18:17:12Z","updated_at":"2017-01-17T11:29:08Z","pushed_at":"2017-01-16T16:29:52Z","git_url":"git://github.com/Flipkart/fk-prof.git","ssh_url":"git@github.com:Flipkart/fk-prof.git","clone_url":"https://github.com/Flipkart/fk-prof.git","svn_url":"https://github.com/Flipkart/fk-prof","homepage":"","size":1284,"stargazers_count":1,"watchers_count":1,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":4,"forks":2,"open_issues":4,"watchers":1,"default_branch":"master"}},"base":{"label":"Flipkart:master","ref":"master","sha":"a526c55ed0f0f20e4b73026169aeb97f087c2f90","user":{"login":"Flipkart","id":1179997,"avatar_url":"https://avatars.githubusercontent.com/u/1179997?v=3","gravatar_id":"","url":"https://api.github.com/users/Flipkart","html_url":"https://github.com/Flipkart","followers_url":"https://api.github.com/users/Flipkart/followers","following_url":"https://api.github.com/users/Flipkart/following{/other_user}","gists_url":"https://api.github.com/users/Flipkart/gists{/gist_id}","starred_url":"https://api.github.com/users/Flipkart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Flipkart/subscriptions","organizations_url":"https://api.github.com/users/Flipkart/orgs","repos_url":"https://api.github.com/users/Flipkart/repos","events_url":"https://api.github.com/users/Flipkart/events{/privacy}","received_events_url":"https://api.github.com/users/Flipkart/received_events","type":"Organization","site_admin":false},"repo":{"id":76980811,"name":"fk-prof","full_name":"Flipkart/fk-prof","owner":{"login":"Flipkart","id":1179997,"avatar_url":"https://avatars.githubusercontent.com/u/1179997?v=3","gravatar_id":"","url":"https://api.github.com/users/Flipkart","html_url":"https://github.com/Flipkart","followers_url":"https://api.github.com/users/Flipkart/followers","following_url":"https://api.github.com/users/Flipkart/following{/other_user}","gists_url":"https://api.github.com/users/Flipkart/gists{/gist_id}","starred_url":"https://api.github.com/users/Flipkart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Flipkart/subscriptions","organizations_url":"https://api.github.com/users/Flipkart/orgs","repos_url":"https://api.github.com/users/Flipkart/repos","events_url":"https://api.github.com/users/Flipkart/events{/privacy}","received_events_url":"https://api.github.com/users/Flipkart/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Flipkart/fk-prof","description":"A functional-context aware java-performance-profiler (based on https://github.com/RichardWarburton/honest-profiler/wiki)","fork":true,"url":"https://api.github.com/repos/Flipkart/fk-prof","forks_url":"https://api.github.com/repos/Flipkart/fk-prof/forks","keys_url":"https://api.github.com/repos/Flipkart/fk-prof/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Flipkart/fk-prof/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Flipkart/fk-prof/teams","hooks_url":"https://api.github.com/repos/Flipkart/fk-prof/hooks","issue_events_url":"https://api.github.com/repos/Flipkart/fk-prof/issues/events{/number}","events_url":"https://api.github.com/repos/Flipkart/fk-prof/events","assignees_url":"https://api.github.com/repos/Flipkart/fk-prof/assignees{/user}","branches_url":"https://api.github.com/repos/Flipkart/fk-prof/branches{/branch}","tags_url":"https://api.github.com/repos/Flipkart/fk-prof/tags","blobs_url":"https://api.github.com/repos/Flipkart/fk-prof/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Flipkart/fk-prof/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Flipkart/fk-prof/git/refs{/sha}","trees_url":"https://api.github.com/repos/Flipkart/fk-prof/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Flipkart/fk-prof/statuses/{sha}","languages_url":"https://api.github.com/repos/Flipkart/fk-prof/languages","stargazers_url":"https://api.github.com/repos/Flipkart/fk-prof/stargazers","contributors_url":"https://api.github.com/repos/Flipkart/fk-prof/contributors","subscribers_url":"https://api.github.com/repos/Flipkart/fk-prof/subscribers","subscription_url":"https://api.github.com/repos/Flipkart/fk-prof/subscription","commits_url":"https://api.github.com/repos/Flipkart/fk-prof/commits{/sha}","git_commits_url":"https://api.github.com/repos/Flipkart/fk-prof/git/commits{/sha}","comments_url":"https://api.github.com/repos/Flipkart/fk-prof/comments{/number}","issue_comment_url":"https://api.github.com/repos/Flipkart/fk-prof/issues/comments{/number}","contents_url":"https://api.github.com/repos/Flipkart/fk-prof/contents/{+path}","compare_url":"https://api.github.com/repos/Flipkart/fk-prof/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Flipkart/fk-prof/merges","archive_url":"https://api.github.com/repos/Flipkart/fk-prof/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Flipkart/fk-prof/downloads","issues_url":"https://api.github.com/repos/Flipkart/fk-prof/issues{/number}","pulls_url":"https://api.github.com/repos/Flipkart/fk-prof/pulls{/number}","milestones_url":"https://api.github.com/repos/Flipkart/fk-prof/milestones{/number}","notifications_url":"https://api.github.com/repos/Flipkart/fk-prof/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Flipkart/fk-prof/labels{/name}","releases_url":"https://api.github.com/repos/Flipkart/fk-prof/releases{/id}","deployments_url":"https://api.github.com/repos/Flipkart/fk-prof/deployments","created_at":"2016-12-20T18:17:12Z","updated_at":"2017-01-17T11:29:08Z","pushed_at":"2017-01-16T16:29:52Z","git_url":"git://github.com/Flipkart/fk-prof.git","ssh_url":"git@github.com:Flipkart/fk-prof.git","clone_url":"https://github.com/Flipkart/fk-prof.git","svn_url":"https://github.com/Flipkart/fk-prof","homepage":"","size":1284,"stargazers_count":1,"watchers_count":1,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":4,"forks":2,"open_issues":4,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Flipkart/fk-prof/pulls/4"},"html":{"href":"https://github.com/Flipkart/fk-prof/pull/4"},"issue":{"href":"https://api.github.com/repos/Flipkart/fk-prof/issues/4"},"comments":{"href":"https://api.github.com/repos/Flipkart/fk-prof/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/Flipkart/fk-prof/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/Flipkart/fk-prof/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Flipkart/fk-prof/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/Flipkart/fk-prof/statuses/7295ef526a2b4211308b0b874c5e656abb28f17f"}}}}
{"actor":{"display_login":"gauravAshok"}}