{"action":"closed","number":8890,"pull_request":{"url":"https://api.github.com/repos/joomla/joomla-cms/pulls/8890","id":55827534,"html_url":"https://github.com/joomla/joomla-cms/pull/8890","diff_url":"https://github.com/joomla/joomla-cms/pull/8890.diff","patch_url":"https://github.com/joomla/joomla-cms/pull/8890.patch","issue_url":"https://api.github.com/repos/joomla/joomla-cms/issues/8890","number":8890,"state":"closed","locked":false,"title":"Add afterRespond event to the Joomla Debug Console","user":{"login":"andrepereiradasilva","id":9630530,"avatar_url":"https://avatars.githubusercontent.com/u/9630530?v=3","gravatar_id":"","url":"https://api.github.com/users/andrepereiradasilva","html_url":"https://github.com/andrepereiradasilva","followers_url":"https://api.github.com/users/andrepereiradasilva/followers","following_url":"https://api.github.com/users/andrepereiradasilva/following{/other_user}","gists_url":"https://api.github.com/users/andrepereiradasilva/gists{/gist_id}","starred_url":"https://api.github.com/users/andrepereiradasilva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrepereiradasilva/subscriptions","organizations_url":"https://api.github.com/users/andrepereiradasilva/orgs","repos_url":"https://api.github.com/users/andrepereiradasilva/repos","events_url":"https://api.github.com/users/andrepereiradasilva/events{/privacy}","received_events_url":"https://api.github.com/users/andrepereiradasilva/received_events","type":"User","site_admin":false},"body":"#### Description\r\n\r\nFollowing https://github.com/joomla/joomla-cms/pull/8888, this PR adds the final event `afterRespond` to the Joomla! Debug Console `Profile Information` block.\r\n\r\nAs it is now Joomla is not returning the real page time because it's not counting the `afterRespond` event.\r\n\r\nTo achive this goal a new event, the `onBeforeEnd`, is created. This event:\r\n- is the last one (load after the `onAfterRespond` events) and before the app closes.\r\n- can only be loaded by the debug system plugin and it was to be enabled.\r\n\r\nSince the `onAfterRespond` events are now in the Profiler too, this PR will also allow to debug the `onAfterRespond` events.\r\n\r\nBefore PR:\r\n![image](https://cloud.githubusercontent.com/assets/9630530/12278208/b02e2976-b977-11e5-8411-e4d4c343c96c.png)\r\n\r\nAfter PR:\r\n![image](https://cloud.githubusercontent.com/assets/9630530/12278187/8e778b74-b977-11e5-9059-28a9fdd8947a.png)\r\n\r\n#### How to test\r\n\r\n1. Apply this patch.\r\n2. Turn on the debug in global config and enale the debug system plugin.\r\n3. Test any page in frontend or admin and check if the `afterRespond` time and memory usage is in the Joomla! Debug Console `Profile Information` block.\r\n4. You can now also test send info to Joomla! Debug Console on a `onAfterRespond`. For instance, add the following php to a system plugin that is enabled, load page and observe if the messages appear in the Joomla! Debug Console.\r\n```php\r\npublic function onAfterRespond()\r\n{\r\n\t// Test to add mark in the profiler Joomla! Debug Console Profile Information block.\r\n\tJDEBUG ? JProfiler::getInstance('Application')->mark('testMark') : null;\r\n\r\n\t// Test to add log message to Log Messages block.\r\n\tJDEBUG ? JLog::add('Test log message to Joomla! Debug Console Log Messages block.', JLog::WARNING, 'deprecated') : null;\r\n\t}\r\n```\r\n#### Observations\r\n\r\nImprovements or suggestions are welcome.","created_at":"2016-01-12T22:31:58Z","updated_at":"2016-09-05T21:56:36Z","closed_at":"2016-09-05T21:56:36Z","merged_at":null,"merge_commit_sha":"693b95b81a62a32a131510f7234189ddd82e1e15","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/joomla/joomla-cms/pulls/8890/commits","review_comments_url":"https://api.github.com/repos/joomla/joomla-cms/pulls/8890/comments","review_comment_url":"https://api.github.com/repos/joomla/joomla-cms/pulls/comments{/number}","comments_url":"https://api.github.com/repos/joomla/joomla-cms/issues/8890/comments","statuses_url":"https://api.github.com/repos/joomla/joomla-cms/statuses/d3aaac431d64d75af281858121bcd965c1c198e7","head":{"label":"andrepereiradasilva:debugger-onBeforeEnd","ref":"debugger-onBeforeEnd","sha":"d3aaac431d64d75af281858121bcd965c1c198e7","user":{"login":"andrepereiradasilva","id":9630530,"avatar_url":"https://avatars.githubusercontent.com/u/9630530?v=3","gravatar_id":"","url":"https://api.github.com/users/andrepereiradasilva","html_url":"https://github.com/andrepereiradasilva","followers_url":"https://api.github.com/users/andrepereiradasilva/followers","following_url":"https://api.github.com/users/andrepereiradasilva/following{/other_user}","gists_url":"https://api.github.com/users/andrepereiradasilva/gists{/gist_id}","starred_url":"https://api.github.com/users/andrepereiradasilva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrepereiradasilva/subscriptions","organizations_url":"https://api.github.com/users/andrepereiradasilva/orgs","repos_url":"https://api.github.com/users/andrepereiradasilva/repos","events_url":"https://api.github.com/users/andrepereiradasilva/events{/privacy}","received_events_url":"https://api.github.com/users/andrepereiradasilva/received_events","type":"User","site_admin":false},"repo":{"id":46170295,"name":"joomla-cms","full_name":"andrepereiradasilva/joomla-cms","owner":{"login":"andrepereiradasilva","id":9630530,"avatar_url":"https://avatars.githubusercontent.com/u/9630530?v=3","gravatar_id":"","url":"https://api.github.com/users/andrepereiradasilva","html_url":"https://github.com/andrepereiradasilva","followers_url":"https://api.github.com/users/andrepereiradasilva/followers","following_url":"https://api.github.com/users/andrepereiradasilva/following{/other_user}","gists_url":"https://api.github.com/users/andrepereiradasilva/gists{/gist_id}","starred_url":"https://api.github.com/users/andrepereiradasilva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrepereiradasilva/subscriptions","organizations_url":"https://api.github.com/users/andrepereiradasilva/orgs","repos_url":"https://api.github.com/users/andrepereiradasilva/repos","events_url":"https://api.github.com/users/andrepereiradasilva/events{/privacy}","received_events_url":"https://api.github.com/users/andrepereiradasilva/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/andrepereiradasilva/joomla-cms","description":"Home of the Joomla! Content Management System","fork":true,"url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms","forks_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/forks","keys_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/teams","hooks_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/hooks","issue_events_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/issues/events{/number}","events_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/events","assignees_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/assignees{/user}","branches_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/branches{/branch}","tags_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/tags","blobs_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/git/refs{/sha}","trees_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/statuses/{sha}","languages_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/languages","stargazers_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/stargazers","contributors_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/contributors","subscribers_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/subscribers","subscription_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/subscription","commits_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/commits{/sha}","git_commits_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/git/commits{/sha}","comments_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/comments{/number}","issue_comment_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/issues/comments{/number}","contents_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/contents/{+path}","compare_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/merges","archive_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/downloads","issues_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/issues{/number}","pulls_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/pulls{/number}","milestones_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/milestones{/number}","notifications_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/labels{/name}","releases_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/releases{/id}","deployments_url":"https://api.github.com/repos/andrepereiradasilva/joomla-cms/deployments","created_at":"2015-11-14T10:22:32Z","updated_at":"2016-03-03T00:12:42Z","pushed_at":"2016-09-05T21:55:40Z","git_url":"git://github.com/andrepereiradasilva/joomla-cms.git","ssh_url":"git@github.com:andrepereiradasilva/joomla-cms.git","clone_url":"https://github.com/andrepereiradasilva/joomla-cms.git","svn_url":"https://github.com/andrepereiradasilva/joomla-cms","homepage":"https://www.joomla.org","size":157628,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":18,"forks":0,"open_issues":18,"watchers":0,"default_branch":"staging"}},"base":{"label":"joomla:staging","ref":"staging","sha":"3218d2bc2f835e976a5d691ecfbc0ca41a686dc0","user":{"login":"joomla","id":751633,"avatar_url":"https://avatars.githubusercontent.com/u/751633?v=3","gravatar_id":"","url":"https://api.github.com/users/joomla","html_url":"https://github.com/joomla","followers_url":"https://api.github.com/users/joomla/followers","following_url":"https://api.github.com/users/joomla/following{/other_user}","gists_url":"https://api.github.com/users/joomla/gists{/gist_id}","starred_url":"https://api.github.com/users/joomla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joomla/subscriptions","organizations_url":"https://api.github.com/users/joomla/orgs","repos_url":"https://api.github.com/users/joomla/repos","events_url":"https://api.github.com/users/joomla/events{/privacy}","received_events_url":"https://api.github.com/users/joomla/received_events","type":"Organization","site_admin":false},"repo":{"id":2464908,"name":"joomla-cms","full_name":"joomla/joomla-cms","owner":{"login":"joomla","id":751633,"avatar_url":"https://avatars.githubusercontent.com/u/751633?v=3","gravatar_id":"","url":"https://api.github.com/users/joomla","html_url":"https://github.com/joomla","followers_url":"https://api.github.com/users/joomla/followers","following_url":"https://api.github.com/users/joomla/following{/other_user}","gists_url":"https://api.github.com/users/joomla/gists{/gist_id}","starred_url":"https://api.github.com/users/joomla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joomla/subscriptions","organizations_url":"https://api.github.com/users/joomla/orgs","repos_url":"https://api.github.com/users/joomla/repos","events_url":"https://api.github.com/users/joomla/events{/privacy}","received_events_url":"https://api.github.com/users/joomla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/joomla/joomla-cms","description":"Home of the Joomla! Content Management System","fork":false,"url":"https://api.github.com/repos/joomla/joomla-cms","forks_url":"https://api.github.com/repos/joomla/joomla-cms/forks","keys_url":"https://api.github.com/repos/joomla/joomla-cms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/joomla/joomla-cms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/joomla/joomla-cms/teams","hooks_url":"https://api.github.com/repos/joomla/joomla-cms/hooks","issue_events_url":"https://api.github.com/repos/joomla/joomla-cms/issues/events{/number}","events_url":"https://api.github.com/repos/joomla/joomla-cms/events","assignees_url":"https://api.github.com/repos/joomla/joomla-cms/assignees{/user}","branches_url":"https://api.github.com/repos/joomla/joomla-cms/branches{/branch}","tags_url":"https://api.github.com/repos/joomla/joomla-cms/tags","blobs_url":"https://api.github.com/repos/joomla/joomla-cms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/joomla/joomla-cms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/joomla/joomla-cms/git/refs{/sha}","trees_url":"https://api.github.com/repos/joomla/joomla-cms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/joomla/joomla-cms/statuses/{sha}","languages_url":"https://api.github.com/repos/joomla/joomla-cms/languages","stargazers_url":"https://api.github.com/repos/joomla/joomla-cms/stargazers","contributors_url":"https://api.github.com/repos/joomla/joomla-cms/contributors","subscribers_url":"https://api.github.com/repos/joomla/joomla-cms/subscribers","subscription_url":"https://api.github.com/repos/joomla/joomla-cms/subscription","commits_url":"https://api.github.com/repos/joomla/joomla-cms/commits{/sha}","git_commits_url":"https://api.github.com/repos/joomla/joomla-cms/git/commits{/sha}","comments_url":"https://api.github.com/repos/joomla/joomla-cms/comments{/number}","issue_comment_url":"https://api.github.com/repos/joomla/joomla-cms/issues/comments{/number}","contents_url":"https://api.github.com/repos/joomla/joomla-cms/contents/{+path}","compare_url":"https://api.github.com/repos/joomla/joomla-cms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/joomla/joomla-cms/merges","archive_url":"https://api.github.com/repos/joomla/joomla-cms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/joomla/joomla-cms/downloads","issues_url":"https://api.github.com/repos/joomla/joomla-cms/issues{/number}","pulls_url":"https://api.github.com/repos/joomla/joomla-cms/pulls{/number}","milestones_url":"https://api.github.com/repos/joomla/joomla-cms/milestones{/number}","notifications_url":"https://api.github.com/repos/joomla/joomla-cms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/joomla/joomla-cms/labels{/name}","releases_url":"https://api.github.com/repos/joomla/joomla-cms/releases{/id}","deployments_url":"https://api.github.com/repos/joomla/joomla-cms/deployments","created_at":"2011-09-27T02:07:38Z","updated_at":"2016-09-05T08:19:02Z","pushed_at":"2016-09-05T21:54:16Z","git_url":"git://github.com/joomla/joomla-cms.git","ssh_url":"git@github.com:joomla/joomla-cms.git","clone_url":"https://github.com/joomla/joomla-cms.git","svn_url":"https://github.com/joomla/joomla-cms","homepage":"https://www.joomla.org","size":294350,"stargazers_count":2130,"watchers_count":2130,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2282,"mirror_url":null,"open_issues_count":427,"forks":2282,"open_issues":427,"watchers":2130,"default_branch":"staging"}},"_links":{"self":{"href":"https://api.github.com/repos/joomla/joomla-cms/pulls/8890"},"html":{"href":"https://github.com/joomla/joomla-cms/pull/8890"},"issue":{"href":"https://api.github.com/repos/joomla/joomla-cms/issues/8890"},"comments":{"href":"https://api.github.com/repos/joomla/joomla-cms/issues/8890/comments"},"review_comments":{"href":"https://api.github.com/repos/joomla/joomla-cms/pulls/8890/comments"},"review_comment":{"href":"https://api.github.com/repos/joomla/joomla-cms/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/joomla/joomla-cms/pulls/8890/commits"},"statuses":{"href":"https://api.github.com/repos/joomla/joomla-cms/statuses/d3aaac431d64d75af281858121bcd965c1c198e7"}},"merged":false,"mergeable":true,"mergeable_state":"clean","merged_by":null,"comments":8,"review_comments":0,"commits":10,"additions":18,"deletions":9,"changed_files":2}}
{"actor":{"display_login":"andrepereiradasilva"}}