{"action":"created","comment":{"url":"https://api.github.com/repos/lenshq/lens_client/pulls/comments/42670014","id":42670014,"diff_hunk":"@@ -21,45 +21,42 @@ def add(event)\n \n     def complete(event)\n       formatted_data = Lens::EventFormatter.new(event, @data, @gc_statistics.total_time).json_formatted\n-      log(formatted_data)\n       send(formatted_data)\n       Thread.current[:__lens_trace] = nil\n     end\n \n-  private\n+    private\n \n     def send(data)\n-      log(data)\n       Worker.instance.push(data)\n     end\n-\n-    def log(data)\n-      Rails.logger.info \"all [LENS] >>> #{data}\" if verbose?\n-    end\n-\n-    def verbose?\n-      false\n-    end\n   end\n \n   class << Trace\n     def process(*args)\n-      name, _started, _finished, id, _data = [*args]\n+      name, _started, _finished, id, _data = args\n       event = ActiveSupport::Notifications::Event.new(*args)\n \n-      if name == 'start_processing.action_controller'\n-        create(id)\n-        Trace.current.add(event)\n-      else\n-        return if Trace.current.blank?\n+      create(id) if first_event?(event)\n \n+      if Trace.current.present?\n         Trace.current.add(event)\n-        if name == 'process_action.action_controller'\n-          Trace.current.complete(event) if event.payload[:controller] && event.payload[:action]\n-        end\n+        Trace.current.complete(event) if last_event?(event)\n       end\n     end\n \n+    private\n+\n+    def first_event?(event)\n+      event.name == 'start_processing.action_controller'\n+    end\n+\n+    def last_event?(event)\n+      event.name == 'process_action.action_controller' &&","path":"lib/lens/trace.rb","position":55,"original_position":55,"commit_id":"1f21cd2cd7534f91d6e177fec84a88c573983798","original_commit_id":"1f21cd2cd7534f91d6e177fec84a88c573983798","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.","created_at":"2015-10-21T19:25:49Z","updated_at":"2015-10-21T19:25:49Z","html_url":"https://github.com/lenshq/lens_client/pull/12#discussion_r42670014","pull_request_url":"https://api.github.com/repos/lenshq/lens_client/pulls/12","_links":{"self":{"href":"https://api.github.com/repos/lenshq/lens_client/pulls/comments/42670014"},"html":{"href":"https://github.com/lenshq/lens_client/pull/12#discussion_r42670014"},"pull_request":{"href":"https://api.github.com/repos/lenshq/lens_client/pulls/12"}}},"pull_request":{"url":"https://api.github.com/repos/lenshq/lens_client/pulls/12","id":47986602,"html_url":"https://github.com/lenshq/lens_client/pull/12","diff_url":"https://github.com/lenshq/lens_client/pull/12.diff","patch_url":"https://github.com/lenshq/lens_client/pull/12.patch","issue_url":"https://api.github.com/repos/lenshq/lens_client/issues/12","number":12,"state":"open","locked":false,"title":"general refactoring","user":{"login":"JanaVPetrova","id":2733977,"avatar_url":"https://avatars.githubusercontent.com/u/2733977?v=3","gravatar_id":"","url":"https://api.github.com/users/JanaVPetrova","html_url":"https://github.com/JanaVPetrova","followers_url":"https://api.github.com/users/JanaVPetrova/followers","following_url":"https://api.github.com/users/JanaVPetrova/following{/other_user}","gists_url":"https://api.github.com/users/JanaVPetrova/gists{/gist_id}","starred_url":"https://api.github.com/users/JanaVPetrova/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JanaVPetrova/subscriptions","organizations_url":"https://api.github.com/users/JanaVPetrova/orgs","repos_url":"https://api.github.com/users/JanaVPetrova/repos","events_url":"https://api.github.com/users/JanaVPetrova/events{/privacy}","received_events_url":"https://api.github.com/users/JanaVPetrova/received_events","type":"User","site_admin":false},"body":"move HEADERS to sender\r\nset instance vars in sender explicitly\r\nremove logging","created_at":"2015-10-17T13:33:01Z","updated_at":"2015-10-21T19:25:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d3a38d7feb161fcbb8e867fe55377382a6d239db","assignee":{"login":"kgorin","id":1277559,"avatar_url":"https://avatars.githubusercontent.com/u/1277559?v=3","gravatar_id":"","url":"https://api.github.com/users/kgorin","html_url":"https://github.com/kgorin","followers_url":"https://api.github.com/users/kgorin/followers","following_url":"https://api.github.com/users/kgorin/following{/other_user}","gists_url":"https://api.github.com/users/kgorin/gists{/gist_id}","starred_url":"https://api.github.com/users/kgorin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kgorin/subscriptions","organizations_url":"https://api.github.com/users/kgorin/orgs","repos_url":"https://api.github.com/users/kgorin/repos","events_url":"https://api.github.com/users/kgorin/events{/privacy}","received_events_url":"https://api.github.com/users/kgorin/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/lenshq/lens_client/pulls/12/commits","review_comments_url":"https://api.github.com/repos/lenshq/lens_client/pulls/12/comments","review_comment_url":"https://api.github.com/repos/lenshq/lens_client/pulls/comments{/number}","comments_url":"https://api.github.com/repos/lenshq/lens_client/issues/12/comments","statuses_url":"https://api.github.com/repos/lenshq/lens_client/statuses/1f21cd2cd7534f91d6e177fec84a88c573983798","head":{"label":"lenshq:feature/enhancements","ref":"feature/enhancements","sha":"1f21cd2cd7534f91d6e177fec84a88c573983798","user":{"login":"lenshq","id":13371271,"avatar_url":"https://avatars.githubusercontent.com/u/13371271?v=3","gravatar_id":"","url":"https://api.github.com/users/lenshq","html_url":"https://github.com/lenshq","followers_url":"https://api.github.com/users/lenshq/followers","following_url":"https://api.github.com/users/lenshq/following{/other_user}","gists_url":"https://api.github.com/users/lenshq/gists{/gist_id}","starred_url":"https://api.github.com/users/lenshq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lenshq/subscriptions","organizations_url":"https://api.github.com/users/lenshq/orgs","repos_url":"https://api.github.com/users/lenshq/repos","events_url":"https://api.github.com/users/lenshq/events{/privacy}","received_events_url":"https://api.github.com/users/lenshq/received_events","type":"Organization","site_admin":false},"repo":{"id":39218905,"name":"lens_client","full_name":"lenshq/lens_client","owner":{"login":"lenshq","id":13371271,"avatar_url":"https://avatars.githubusercontent.com/u/13371271?v=3","gravatar_id":"","url":"https://api.github.com/users/lenshq","html_url":"https://github.com/lenshq","followers_url":"https://api.github.com/users/lenshq/followers","following_url":"https://api.github.com/users/lenshq/following{/other_user}","gists_url":"https://api.github.com/users/lenshq/gists{/gist_id}","starred_url":"https://api.github.com/users/lenshq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lenshq/subscriptions","organizations_url":"https://api.github.com/users/lenshq/orgs","repos_url":"https://api.github.com/users/lenshq/repos","events_url":"https://api.github.com/users/lenshq/events{/privacy}","received_events_url":"https://api.github.com/users/lenshq/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/lenshq/lens_client","description":"Ruby client. Part of Lens – profiling tool for Rails apps","fork":false,"url":"https://api.github.com/repos/lenshq/lens_client","forks_url":"https://api.github.com/repos/lenshq/lens_client/forks","keys_url":"https://api.github.com/repos/lenshq/lens_client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lenshq/lens_client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lenshq/lens_client/teams","hooks_url":"https://api.github.com/repos/lenshq/lens_client/hooks","issue_events_url":"https://api.github.com/repos/lenshq/lens_client/issues/events{/number}","events_url":"https://api.github.com/repos/lenshq/lens_client/events","assignees_url":"https://api.github.com/repos/lenshq/lens_client/assignees{/user}","branches_url":"https://api.github.com/repos/lenshq/lens_client/branches{/branch}","tags_url":"https://api.github.com/repos/lenshq/lens_client/tags","blobs_url":"https://api.github.com/repos/lenshq/lens_client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lenshq/lens_client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lenshq/lens_client/git/refs{/sha}","trees_url":"https://api.github.com/repos/lenshq/lens_client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lenshq/lens_client/statuses/{sha}","languages_url":"https://api.github.com/repos/lenshq/lens_client/languages","stargazers_url":"https://api.github.com/repos/lenshq/lens_client/stargazers","contributors_url":"https://api.github.com/repos/lenshq/lens_client/contributors","subscribers_url":"https://api.github.com/repos/lenshq/lens_client/subscribers","subscription_url":"https://api.github.com/repos/lenshq/lens_client/subscription","commits_url":"https://api.github.com/repos/lenshq/lens_client/commits{/sha}","git_commits_url":"https://api.github.com/repos/lenshq/lens_client/git/commits{/sha}","comments_url":"https://api.github.com/repos/lenshq/lens_client/comments{/number}","issue_comment_url":"https://api.github.com/repos/lenshq/lens_client/issues/comments{/number}","contents_url":"https://api.github.com/repos/lenshq/lens_client/contents/{+path}","compare_url":"https://api.github.com/repos/lenshq/lens_client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lenshq/lens_client/merges","archive_url":"https://api.github.com/repos/lenshq/lens_client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lenshq/lens_client/downloads","issues_url":"https://api.github.com/repos/lenshq/lens_client/issues{/number}","pulls_url":"https://api.github.com/repos/lenshq/lens_client/pulls{/number}","milestones_url":"https://api.github.com/repos/lenshq/lens_client/milestones{/number}","notifications_url":"https://api.github.com/repos/lenshq/lens_client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lenshq/lens_client/labels{/name}","releases_url":"https://api.github.com/repos/lenshq/lens_client/releases{/id}","created_at":"2015-07-16T20:27:50Z","updated_at":"2015-09-28T05:46:51Z","pushed_at":"2015-10-21T19:25:46Z","git_url":"git://github.com/lenshq/lens_client.git","ssh_url":"git@github.com:lenshq/lens_client.git","clone_url":"https://github.com/lenshq/lens_client.git","svn_url":"https://github.com/lenshq/lens_client","homepage":"","size":348,"stargazers_count":3,"watchers_count":3,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":15,"forks":0,"open_issues":15,"watchers":3,"default_branch":"master"}},"base":{"label":"lenshq:async_sender","ref":"async_sender","sha":"7baa4d35381181e698d7a5398063507b7d5027ce","user":{"login":"lenshq","id":13371271,"avatar_url":"https://avatars.githubusercontent.com/u/13371271?v=3","gravatar_id":"","url":"https://api.github.com/users/lenshq","html_url":"https://github.com/lenshq","followers_url":"https://api.github.com/users/lenshq/followers","following_url":"https://api.github.com/users/lenshq/following{/other_user}","gists_url":"https://api.github.com/users/lenshq/gists{/gist_id}","starred_url":"https://api.github.com/users/lenshq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lenshq/subscriptions","organizations_url":"https://api.github.com/users/lenshq/orgs","repos_url":"https://api.github.com/users/lenshq/repos","events_url":"https://api.github.com/users/lenshq/events{/privacy}","received_events_url":"https://api.github.com/users/lenshq/received_events","type":"Organization","site_admin":false},"repo":{"id":39218905,"name":"lens_client","full_name":"lenshq/lens_client","owner":{"login":"lenshq","id":13371271,"avatar_url":"https://avatars.githubusercontent.com/u/13371271?v=3","gravatar_id":"","url":"https://api.github.com/users/lenshq","html_url":"https://github.com/lenshq","followers_url":"https://api.github.com/users/lenshq/followers","following_url":"https://api.github.com/users/lenshq/following{/other_user}","gists_url":"https://api.github.com/users/lenshq/gists{/gist_id}","starred_url":"https://api.github.com/users/lenshq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lenshq/subscriptions","organizations_url":"https://api.github.com/users/lenshq/orgs","repos_url":"https://api.github.com/users/lenshq/repos","events_url":"https://api.github.com/users/lenshq/events{/privacy}","received_events_url":"https://api.github.com/users/lenshq/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/lenshq/lens_client","description":"Ruby client. Part of Lens – profiling tool for Rails apps","fork":false,"url":"https://api.github.com/repos/lenshq/lens_client","forks_url":"https://api.github.com/repos/lenshq/lens_client/forks","keys_url":"https://api.github.com/repos/lenshq/lens_client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lenshq/lens_client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lenshq/lens_client/teams","hooks_url":"https://api.github.com/repos/lenshq/lens_client/hooks","issue_events_url":"https://api.github.com/repos/lenshq/lens_client/issues/events{/number}","events_url":"https://api.github.com/repos/lenshq/lens_client/events","assignees_url":"https://api.github.com/repos/lenshq/lens_client/assignees{/user}","branches_url":"https://api.github.com/repos/lenshq/lens_client/branches{/branch}","tags_url":"https://api.github.com/repos/lenshq/lens_client/tags","blobs_url":"https://api.github.com/repos/lenshq/lens_client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lenshq/lens_client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lenshq/lens_client/git/refs{/sha}","trees_url":"https://api.github.com/repos/lenshq/lens_client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lenshq/lens_client/statuses/{sha}","languages_url":"https://api.github.com/repos/lenshq/lens_client/languages","stargazers_url":"https://api.github.com/repos/lenshq/lens_client/stargazers","contributors_url":"https://api.github.com/repos/lenshq/lens_client/contributors","subscribers_url":"https://api.github.com/repos/lenshq/lens_client/subscribers","subscription_url":"https://api.github.com/repos/lenshq/lens_client/subscription","commits_url":"https://api.github.com/repos/lenshq/lens_client/commits{/sha}","git_commits_url":"https://api.github.com/repos/lenshq/lens_client/git/commits{/sha}","comments_url":"https://api.github.com/repos/lenshq/lens_client/comments{/number}","issue_comment_url":"https://api.github.com/repos/lenshq/lens_client/issues/comments{/number}","contents_url":"https://api.github.com/repos/lenshq/lens_client/contents/{+path}","compare_url":"https://api.github.com/repos/lenshq/lens_client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lenshq/lens_client/merges","archive_url":"https://api.github.com/repos/lenshq/lens_client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lenshq/lens_client/downloads","issues_url":"https://api.github.com/repos/lenshq/lens_client/issues{/number}","pulls_url":"https://api.github.com/repos/lenshq/lens_client/pulls{/number}","milestones_url":"https://api.github.com/repos/lenshq/lens_client/milestones{/number}","notifications_url":"https://api.github.com/repos/lenshq/lens_client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lenshq/lens_client/labels{/name}","releases_url":"https://api.github.com/repos/lenshq/lens_client/releases{/id}","created_at":"2015-07-16T20:27:50Z","updated_at":"2015-09-28T05:46:51Z","pushed_at":"2015-10-21T19:25:46Z","git_url":"git://github.com/lenshq/lens_client.git","ssh_url":"git@github.com:lenshq/lens_client.git","clone_url":"https://github.com/lenshq/lens_client.git","svn_url":"https://github.com/lenshq/lens_client","homepage":"","size":348,"stargazers_count":3,"watchers_count":3,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":15,"forks":0,"open_issues":15,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/lenshq/lens_client/pulls/12"},"html":{"href":"https://github.com/lenshq/lens_client/pull/12"},"issue":{"href":"https://api.github.com/repos/lenshq/lens_client/issues/12"},"comments":{"href":"https://api.github.com/repos/lenshq/lens_client/issues/12/comments"},"review_comments":{"href":"https://api.github.com/repos/lenshq/lens_client/pulls/12/comments"},"review_comment":{"href":"https://api.github.com/repos/lenshq/lens_client/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/lenshq/lens_client/pulls/12/commits"},"statuses":{"href":"https://api.github.com/repos/lenshq/lens_client/statuses/1f21cd2cd7534f91d6e177fec84a88c573983798"}}}}