{"action":"created","comment":{"url":"https://api.github.com/repos/yiisoft/yii2-debug/pulls/comments/79049952","id":79049952,"diff_hunk":"@@ -0,0 +1,144 @@\n+<?php\n+/**\n+ * @link http://www.yiiframework.com/\n+ * @copyright Copyright (c) 2008 Yii Software LLC\n+ * @license http://www.yiiframework.com/license/\n+ */\n+\n+namespace yii\\debug\\components;\n+\n+use yii\\data\\ArrayDataProvider;\n+\n+/**\n+ * TimelineDataProvider implements a data provider based on a data array.\n+ * @author Dmitriy Bashkarev <dmitriy@bashkarev.com>\n+ * @since 2.0.7\n+ */\n+class TimelineDataProvider extends ArrayDataProvider\n+{\n+    /**\n+     * start request, timestamp\n+     * @var float\n+     */\n+    public $start;\n+\n+    /**\n+     * end request, timestamp\n+     * @var float\n+     */\n+    public $end;\n+\n+    /**\n+     * request duration\n+     * @var float\n+     */\n+    public $duration;\n+\n+    /**\n+     * @inheritdoc\n+     */\n+    protected function prepareModels()\n+    {\n+        if (($models = $this->allModels) === null) {\n+            return [];\n+        }\n+        $child = [];\n+        foreach ($models as $key => &$model) {\n+            $model['timestamp'] *= 1000;\n+            $model['duration'] *= 1000;\n+            $model['child'] = 0;\n+            $model['css']['width'] = $this->getWidth($model);\n+            $model['css']['left'] = $this->getLeft($model);\n+            $model['css']['color'] = $this->getColor($model);\n+            foreach ($child as $id => $timestamp) {\n+                if ($timestamp > $model['timestamp']) {\n+                    ++$models[$id]['child'];\n+                } else {\n+                    unset($child[$id]);\n+                }\n+            }\n+            $child[$key] = $model['timestamp'] + $model['duration'];\n+        }\n+        return $models;\n+    }\n+\n+    /**\n+     * item, hex color","path":"components/TimelineDataProvider.php","position":66,"original_position":66,"commit_id":"c1a7fa153bad79660ceef0875e8da962be9ed5b7","original_commit_id":"c1a7fa153bad79660ceef0875e8da962be9ed5b7","user":{"login":"samdark","id":47294,"avatar_url":"https://avatars.githubusercontent.com/u/47294?v=3","gravatar_id":"","url":"https://api.github.com/users/samdark","html_url":"https://github.com/samdark","followers_url":"https://api.github.com/users/samdark/followers","following_url":"https://api.github.com/users/samdark/following{/other_user}","gists_url":"https://api.github.com/users/samdark/gists{/gist_id}","starred_url":"https://api.github.com/users/samdark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samdark/subscriptions","organizations_url":"https://api.github.com/users/samdark/orgs","repos_url":"https://api.github.com/users/samdark/repos","events_url":"https://api.github.com/users/samdark/events{/privacy}","received_events_url":"https://api.github.com/users/samdark/received_events","type":"User","site_admin":false},"body":"Need a better description like `Getting HEX color based on model duration`.","created_at":"2016-09-15T20:06:44Z","updated_at":"2016-09-15T20:08:52Z","html_url":"https://github.com/yiisoft/yii2-debug/pull/121#discussion_r79049952","pull_request_url":"https://api.github.com/repos/yiisoft/yii2-debug/pulls/121","_links":{"self":{"href":"https://api.github.com/repos/yiisoft/yii2-debug/pulls/comments/79049952"},"html":{"href":"https://github.com/yiisoft/yii2-debug/pull/121#discussion_r79049952"},"pull_request":{"href":"https://api.github.com/repos/yiisoft/yii2-debug/pulls/121"}}},"pull_request":{"url":"https://api.github.com/repos/yiisoft/yii2-debug/pulls/121","id":83274592,"html_url":"https://github.com/yiisoft/yii2-debug/pull/121","diff_url":"https://github.com/yiisoft/yii2-debug/pull/121.diff","patch_url":"https://github.com/yiisoft/yii2-debug/pull/121.patch","issue_url":"https://api.github.com/repos/yiisoft/yii2-debug/issues/121","number":121,"state":"open","locked":false,"title":"Profiling timeline #58","user":{"login":"bashkarev","id":3738201,"avatar_url":"https://avatars.githubusercontent.com/u/3738201?v=3","gravatar_id":"","url":"https://api.github.com/users/bashkarev","html_url":"https://github.com/bashkarev","followers_url":"https://api.github.com/users/bashkarev/followers","following_url":"https://api.github.com/users/bashkarev/following{/other_user}","gists_url":"https://api.github.com/users/bashkarev/gists{/gist_id}","starred_url":"https://api.github.com/users/bashkarev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bashkarev/subscriptions","organizations_url":"https://api.github.com/users/bashkarev/orgs","repos_url":"https://api.github.com/users/bashkarev/repos","events_url":"https://api.github.com/users/bashkarev/events{/privacy}","received_events_url":"https://api.github.com/users/bashkarev/received_events","type":"User","site_admin":false},"body":"| Q             | A\r\n| ------------- | ---\r\n| Is bugfix?    | no\r\n| New feature?  | yes\r\n| Breaks BC?    | yes\r\n| Tests pass?   | yes\r\n| Fixed issues  | #58 \r\n\r\n![timeline](https://cloud.githubusercontent.com/assets/3738201/18091011/d8ce571c-6ecf-11e6-8a90-93dd19e16b0b.gif)\r\n\r\n","created_at":"2016-08-30T13:48:41Z","updated_at":"2016-09-15T20:08:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cb7981e45509bf2ebbd97736e4289796fe653f0b","assignee":{"login":"samdark","id":47294,"avatar_url":"https://avatars.githubusercontent.com/u/47294?v=3","gravatar_id":"","url":"https://api.github.com/users/samdark","html_url":"https://github.com/samdark","followers_url":"https://api.github.com/users/samdark/followers","following_url":"https://api.github.com/users/samdark/following{/other_user}","gists_url":"https://api.github.com/users/samdark/gists{/gist_id}","starred_url":"https://api.github.com/users/samdark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samdark/subscriptions","organizations_url":"https://api.github.com/users/samdark/orgs","repos_url":"https://api.github.com/users/samdark/repos","events_url":"https://api.github.com/users/samdark/events{/privacy}","received_events_url":"https://api.github.com/users/samdark/received_events","type":"User","site_admin":false},"assignees":[{"login":"samdark","id":47294,"avatar_url":"https://avatars.githubusercontent.com/u/47294?v=3","gravatar_id":"","url":"https://api.github.com/users/samdark","html_url":"https://github.com/samdark","followers_url":"https://api.github.com/users/samdark/followers","following_url":"https://api.github.com/users/samdark/following{/other_user}","gists_url":"https://api.github.com/users/samdark/gists{/gist_id}","starred_url":"https://api.github.com/users/samdark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samdark/subscriptions","organizations_url":"https://api.github.com/users/samdark/orgs","repos_url":"https://api.github.com/users/samdark/repos","events_url":"https://api.github.com/users/samdark/events{/privacy}","received_events_url":"https://api.github.com/users/samdark/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/yiisoft/yii2-debug/milestones/5","html_url":"https://github.com/yiisoft/yii2-debug/milestones/2.0.7","labels_url":"https://api.github.com/repos/yiisoft/yii2-debug/milestones/5/labels","id":1244150,"number":5,"title":"2.0.7","description":"","creator":{"login":"cebe","id":189796,"avatar_url":"https://avatars.githubusercontent.com/u/189796?v=3","gravatar_id":"","url":"https://api.github.com/users/cebe","html_url":"https://github.com/cebe","followers_url":"https://api.github.com/users/cebe/followers","following_url":"https://api.github.com/users/cebe/following{/other_user}","gists_url":"https://api.github.com/users/cebe/gists{/gist_id}","starred_url":"https://api.github.com/users/cebe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cebe/subscriptions","organizations_url":"https://api.github.com/users/cebe/orgs","repos_url":"https://api.github.com/users/cebe/repos","events_url":"https://api.github.com/users/cebe/events{/privacy}","received_events_url":"https://api.github.com/users/cebe/received_events","type":"User","site_admin":false},"open_issues":6,"closed_issues":11,"state":"open","created_at":"2015-08-06T16:18:13Z","updated_at":"2016-08-30T14:08:42Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/yiisoft/yii2-debug/pulls/121/commits","review_comments_url":"https://api.github.com/repos/yiisoft/yii2-debug/pulls/121/comments","review_comment_url":"https://api.github.com/repos/yiisoft/yii2-debug/pulls/comments{/number}","comments_url":"https://api.github.com/repos/yiisoft/yii2-debug/issues/121/comments","statuses_url":"https://api.github.com/repos/yiisoft/yii2-debug/statuses/c1a7fa153bad79660ceef0875e8da962be9ed5b7","head":{"label":"bashkarev:master","ref":"master","sha":"c1a7fa153bad79660ceef0875e8da962be9ed5b7","user":{"login":"bashkarev","id":3738201,"avatar_url":"https://avatars.githubusercontent.com/u/3738201?v=3","gravatar_id":"","url":"https://api.github.com/users/bashkarev","html_url":"https://github.com/bashkarev","followers_url":"https://api.github.com/users/bashkarev/followers","following_url":"https://api.github.com/users/bashkarev/following{/other_user}","gists_url":"https://api.github.com/users/bashkarev/gists{/gist_id}","starred_url":"https://api.github.com/users/bashkarev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bashkarev/subscriptions","organizations_url":"https://api.github.com/users/bashkarev/orgs","repos_url":"https://api.github.com/users/bashkarev/repos","events_url":"https://api.github.com/users/bashkarev/events{/privacy}","received_events_url":"https://api.github.com/users/bashkarev/received_events","type":"User","site_admin":false},"repo":{"id":66343652,"name":"yii2-debug","full_name":"bashkarev/yii2-debug","owner":{"login":"bashkarev","id":3738201,"avatar_url":"https://avatars.githubusercontent.com/u/3738201?v=3","gravatar_id":"","url":"https://api.github.com/users/bashkarev","html_url":"https://github.com/bashkarev","followers_url":"https://api.github.com/users/bashkarev/followers","following_url":"https://api.github.com/users/bashkarev/following{/other_user}","gists_url":"https://api.github.com/users/bashkarev/gists{/gist_id}","starred_url":"https://api.github.com/users/bashkarev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bashkarev/subscriptions","organizations_url":"https://api.github.com/users/bashkarev/orgs","repos_url":"https://api.github.com/users/bashkarev/repos","events_url":"https://api.github.com/users/bashkarev/events{/privacy}","received_events_url":"https://api.github.com/users/bashkarev/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bashkarev/yii2-debug","description":"Yii 2 Debug Extension.","fork":true,"url":"https://api.github.com/repos/bashkarev/yii2-debug","forks_url":"https://api.github.com/repos/bashkarev/yii2-debug/forks","keys_url":"https://api.github.com/repos/bashkarev/yii2-debug/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bashkarev/yii2-debug/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bashkarev/yii2-debug/teams","hooks_url":"https://api.github.com/repos/bashkarev/yii2-debug/hooks","issue_events_url":"https://api.github.com/repos/bashkarev/yii2-debug/issues/events{/number}","events_url":"https://api.github.com/repos/bashkarev/yii2-debug/events","assignees_url":"https://api.github.com/repos/bashkarev/yii2-debug/assignees{/user}","branches_url":"https://api.github.com/repos/bashkarev/yii2-debug/branches{/branch}","tags_url":"https://api.github.com/repos/bashkarev/yii2-debug/tags","blobs_url":"https://api.github.com/repos/bashkarev/yii2-debug/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bashkarev/yii2-debug/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bashkarev/yii2-debug/git/refs{/sha}","trees_url":"https://api.github.com/repos/bashkarev/yii2-debug/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bashkarev/yii2-debug/statuses/{sha}","languages_url":"https://api.github.com/repos/bashkarev/yii2-debug/languages","stargazers_url":"https://api.github.com/repos/bashkarev/yii2-debug/stargazers","contributors_url":"https://api.github.com/repos/bashkarev/yii2-debug/contributors","subscribers_url":"https://api.github.com/repos/bashkarev/yii2-debug/subscribers","subscription_url":"https://api.github.com/repos/bashkarev/yii2-debug/subscription","commits_url":"https://api.github.com/repos/bashkarev/yii2-debug/commits{/sha}","git_commits_url":"https://api.github.com/repos/bashkarev/yii2-debug/git/commits{/sha}","comments_url":"https://api.github.com/repos/bashkarev/yii2-debug/comments{/number}","issue_comment_url":"https://api.github.com/repos/bashkarev/yii2-debug/issues/comments{/number}","contents_url":"https://api.github.com/repos/bashkarev/yii2-debug/contents/{+path}","compare_url":"https://api.github.com/repos/bashkarev/yii2-debug/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bashkarev/yii2-debug/merges","archive_url":"https://api.github.com/repos/bashkarev/yii2-debug/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bashkarev/yii2-debug/downloads","issues_url":"https://api.github.com/repos/bashkarev/yii2-debug/issues{/number}","pulls_url":"https://api.github.com/repos/bashkarev/yii2-debug/pulls{/number}","milestones_url":"https://api.github.com/repos/bashkarev/yii2-debug/milestones{/number}","notifications_url":"https://api.github.com/repos/bashkarev/yii2-debug/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bashkarev/yii2-debug/labels{/name}","releases_url":"https://api.github.com/repos/bashkarev/yii2-debug/releases{/id}","deployments_url":"https://api.github.com/repos/bashkarev/yii2-debug/deployments","created_at":"2016-08-23T07:23:07Z","updated_at":"2016-08-23T07:24:21Z","pushed_at":"2016-09-15T14:02:00Z","git_url":"git://github.com/bashkarev/yii2-debug.git","ssh_url":"git@github.com:bashkarev/yii2-debug.git","clone_url":"https://github.com/bashkarev/yii2-debug.git","svn_url":"https://github.com/bashkarev/yii2-debug","homepage":"http://www.yiiframework.com","size":10154,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"yiisoft:master","ref":"master","sha":"721045af916ed66cf217f4fe66137348a165e54c","user":{"login":"yiisoft","id":993323,"avatar_url":"https://avatars.githubusercontent.com/u/993323?v=3","gravatar_id":"","url":"https://api.github.com/users/yiisoft","html_url":"https://github.com/yiisoft","followers_url":"https://api.github.com/users/yiisoft/followers","following_url":"https://api.github.com/users/yiisoft/following{/other_user}","gists_url":"https://api.github.com/users/yiisoft/gists{/gist_id}","starred_url":"https://api.github.com/users/yiisoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yiisoft/subscriptions","organizations_url":"https://api.github.com/users/yiisoft/orgs","repos_url":"https://api.github.com/users/yiisoft/repos","events_url":"https://api.github.com/users/yiisoft/events{/privacy}","received_events_url":"https://api.github.com/users/yiisoft/received_events","type":"Organization","site_admin":false},"repo":{"id":14080033,"name":"yii2-debug","full_name":"yiisoft/yii2-debug","owner":{"login":"yiisoft","id":993323,"avatar_url":"https://avatars.githubusercontent.com/u/993323?v=3","gravatar_id":"","url":"https://api.github.com/users/yiisoft","html_url":"https://github.com/yiisoft","followers_url":"https://api.github.com/users/yiisoft/followers","following_url":"https://api.github.com/users/yiisoft/following{/other_user}","gists_url":"https://api.github.com/users/yiisoft/gists{/gist_id}","starred_url":"https://api.github.com/users/yiisoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yiisoft/subscriptions","organizations_url":"https://api.github.com/users/yiisoft/orgs","repos_url":"https://api.github.com/users/yiisoft/repos","events_url":"https://api.github.com/users/yiisoft/events{/privacy}","received_events_url":"https://api.github.com/users/yiisoft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/yiisoft/yii2-debug","description":"Yii 2 Debug Extension.","fork":false,"url":"https://api.github.com/repos/yiisoft/yii2-debug","forks_url":"https://api.github.com/repos/yiisoft/yii2-debug/forks","keys_url":"https://api.github.com/repos/yiisoft/yii2-debug/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yiisoft/yii2-debug/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yiisoft/yii2-debug/teams","hooks_url":"https://api.github.com/repos/yiisoft/yii2-debug/hooks","issue_events_url":"https://api.github.com/repos/yiisoft/yii2-debug/issues/events{/number}","events_url":"https://api.github.com/repos/yiisoft/yii2-debug/events","assignees_url":"https://api.github.com/repos/yiisoft/yii2-debug/assignees{/user}","branches_url":"https://api.github.com/repos/yiisoft/yii2-debug/branches{/branch}","tags_url":"https://api.github.com/repos/yiisoft/yii2-debug/tags","blobs_url":"https://api.github.com/repos/yiisoft/yii2-debug/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yiisoft/yii2-debug/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yiisoft/yii2-debug/git/refs{/sha}","trees_url":"https://api.github.com/repos/yiisoft/yii2-debug/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yiisoft/yii2-debug/statuses/{sha}","languages_url":"https://api.github.com/repos/yiisoft/yii2-debug/languages","stargazers_url":"https://api.github.com/repos/yiisoft/yii2-debug/stargazers","contributors_url":"https://api.github.com/repos/yiisoft/yii2-debug/contributors","subscribers_url":"https://api.github.com/repos/yiisoft/yii2-debug/subscribers","subscription_url":"https://api.github.com/repos/yiisoft/yii2-debug/subscription","commits_url":"https://api.github.com/repos/yiisoft/yii2-debug/commits{/sha}","git_commits_url":"https://api.github.com/repos/yiisoft/yii2-debug/git/commits{/sha}","comments_url":"https://api.github.com/repos/yiisoft/yii2-debug/comments{/number}","issue_comment_url":"https://api.github.com/repos/yiisoft/yii2-debug/issues/comments{/number}","contents_url":"https://api.github.com/repos/yiisoft/yii2-debug/contents/{+path}","compare_url":"https://api.github.com/repos/yiisoft/yii2-debug/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yiisoft/yii2-debug/merges","archive_url":"https://api.github.com/repos/yiisoft/yii2-debug/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yiisoft/yii2-debug/downloads","issues_url":"https://api.github.com/repos/yiisoft/yii2-debug/issues{/number}","pulls_url":"https://api.github.com/repos/yiisoft/yii2-debug/pulls{/number}","milestones_url":"https://api.github.com/repos/yiisoft/yii2-debug/milestones{/number}","notifications_url":"https://api.github.com/repos/yiisoft/yii2-debug/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yiisoft/yii2-debug/labels{/name}","releases_url":"https://api.github.com/repos/yiisoft/yii2-debug/releases{/id}","deployments_url":"https://api.github.com/repos/yiisoft/yii2-debug/deployments","created_at":"2013-11-03T04:18:06Z","updated_at":"2016-09-02T18:59:58Z","pushed_at":"2016-09-15T14:02:01Z","git_url":"git://github.com/yiisoft/yii2-debug.git","ssh_url":"git@github.com:yiisoft/yii2-debug.git","clone_url":"https://github.com/yiisoft/yii2-debug.git","svn_url":"https://github.com/yiisoft/yii2-debug","homepage":"http://www.yiiframework.com","size":13094,"stargazers_count":45,"watchers_count":45,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":53,"mirror_url":null,"open_issues_count":39,"forks":53,"open_issues":39,"watchers":45,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/yiisoft/yii2-debug/pulls/121"},"html":{"href":"https://github.com/yiisoft/yii2-debug/pull/121"},"issue":{"href":"https://api.github.com/repos/yiisoft/yii2-debug/issues/121"},"comments":{"href":"https://api.github.com/repos/yiisoft/yii2-debug/issues/121/comments"},"review_comments":{"href":"https://api.github.com/repos/yiisoft/yii2-debug/pulls/121/comments"},"review_comment":{"href":"https://api.github.com/repos/yiisoft/yii2-debug/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/yiisoft/yii2-debug/pulls/121/commits"},"statuses":{"href":"https://api.github.com/repos/yiisoft/yii2-debug/statuses/c1a7fa153bad79660ceef0875e8da962be9ed5b7"}}}}
{"actor":{"display_login":"samdark"}}