{"action":"created","comment":{"url":"https://api.github.com/repos/Flipkart/fk-prof/pulls/comments/96495758","pull_request_review_id":17079018,"id":96495758,"diff_hunk":"@@ -0,0 +1,41 @@\n+package fk.prof.backend.service;\n+\n+import fk.prof.backend.aggregator.AggregationWindow;\n+\n+import java.util.concurrent.ConcurrentHashMap;\n+\n+//TODO: Liable for refactoring. For now, placeholder to enable functional completion of /profile api\n+public class ProfileWorkService implements IProfileWorkService {\n+  private AggregationWindowStore aggregationWindowStore = new AggregationWindowStore();\n+\n+  public void associateAggregationWindow(Long workId, AggregationWindow aggregationWindow) {\n+    this.aggregationWindowStore.add(workId, aggregationWindow);\n+  }\n+\n+  public AggregationWindow getAssociatedAggregationWindow(Long workId) {\n+    return this.aggregationWindowStore.get(workId);\n+  }\n+\n+  /**\n+   * TODO: Evaluate if this is the right DS. Temporary for now\n+   * Ideally, there should be separate in-memory store/persistent store impl for storing work-id related data model\n+   */\n+  public static class AggregationWindowStore {\n+\n+    private ConcurrentHashMap<Long, AggregationWindow> windowLookup = new ConcurrentHashMap<>();\n+\n+    public void add(long workId, AggregationWindow window) {\n+      this.windowLookup.putIfAbsent(workId, window);\n+    }\n+\n+    public AggregationWindow get(long workId) {\n+      return this.windowLookup.get(workId);\n+    }\n+\n+    public void removeWorkIds(long[] workIds) {","path":"backend/src/main/java/fk/prof/backend/service/ProfileWorkService.java","position":35,"original_position":35,"commit_id":"7295ef526a2b4211308b0b874c5e656abb28f17f","original_commit_id":"7295ef526a2b4211308b0b874c5e656abb28f17f","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":"So I have kept around a bunch of such functions because I see them immediately getting used when aggregation window expiry related code comes in. Another example is abandonProfile method in AggregationWindow class. Deleting them right now, only to add them a week later (mostly by the same dev) does not make sense. Of course, relevant test for these will be added later so there is a small risk of incorrect code being merged early but it should be anyways caught when we write the classes using this method.","created_at":"2017-01-17T19:52:41Z","updated_at":"2017-01-17T19:52:41Z","html_url":"https://github.com/Flipkart/fk-prof/pull/4#discussion_r96495758","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/96495758"},"html":{"href":"https://github.com/Flipkart/fk-prof/pull/4#discussion_r96495758"},"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-17T19:52:41Z","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-17T19:06:28Z","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":1292,"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":5,"forks":2,"open_issues":5,"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-17T19:06:28Z","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":1292,"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":5,"forks":2,"open_issues":5,"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":"fk-ajain"}}