{"action":"created","comment":{"url":"https://api.github.com/repos/cljdoc/cljdoc/pulls/comments/226869192","pull_request_review_id":166791878,"id":226869192,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNjg2OTE5Mg==","diff_hunk":"@@ -170,6 +171,35 @@\n             (Instant/parse d2)))]\n     (str \"+\" s \"s\")))\n \n+(defn build-aggregates\n+  \"Given builds, calculate aggregate values.\n+  Returns a map containing total builds, failed builds, failure percentage.\"\n+  [builds]\n+  (let [build-cnt (count builds)\n+        failed-build-cnt (->> builds\n+                              (filter #(some? (:error %)))\n+                              count)]\n+    {:date (-> builds\n+               first\n+               :analysis_triggered_ts\n+               dt/->analytics-format)\n+     :total build-cnt\n+     :failed failed-build-cnt\n+     :percent-failed (* 100 (/ failed-build-cnt build-cnt))}))\n+\n+(defn build-analytics\n+  [build-aggregates]\n+  [:div.mb2\n+   (->> build-aggregates\n+        (take 5)\n+        (map (fn [{:keys [date total failed percent-failed]}]\n+               [:dl.dib.w-20\n+                [:dd.f6.f6-ns.ml0 date]","path":"src/cljdoc/render/build_log.clj","position":38,"original_position":38,"commit_id":"58abede8afdb446b360fe896e5469615a76c65dc","original_commit_id":"58abede8afdb446b360fe896e5469615a76c65dc","user":{"login":"martinklepsch","id":97496,"node_id":"MDQ6VXNlcjk3NDk2","avatar_url":"https://avatars3.githubusercontent.com/u/97496?v=4","gravatar_id":"","url":"https://api.github.com/users/martinklepsch","html_url":"https://github.com/martinklepsch","followers_url":"https://api.github.com/users/martinklepsch/followers","following_url":"https://api.github.com/users/martinklepsch/following{/other_user}","gists_url":"https://api.github.com/users/martinklepsch/gists{/gist_id}","starred_url":"https://api.github.com/users/martinklepsch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martinklepsch/subscriptions","organizations_url":"https://api.github.com/users/martinklepsch/orgs","repos_url":"https://api.github.com/users/martinklepsch/repos","events_url":"https://api.github.com/users/martinklepsch/events{/privacy}","received_events_url":"https://api.github.com/users/martinklepsch/received_events","type":"User","site_admin":false},"body":"```suggestion\r\n                [:dd.f6.ml0 date]\r\n```\r\n😄 ","created_at":"2018-10-21T16:33:07Z","updated_at":"2018-10-21T16:33:07Z","html_url":"https://github.com/cljdoc/cljdoc/pull/173#discussion_r226869192","pull_request_url":"https://api.github.com/repos/cljdoc/cljdoc/pulls/173","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/cljdoc/cljdoc/pulls/comments/226869192"},"html":{"href":"https://github.com/cljdoc/cljdoc/pull/173#discussion_r226869192"},"pull_request":{"href":"https://api.github.com/repos/cljdoc/cljdoc/pulls/173"}}},"pull_request":{"url":"https://api.github.com/repos/cljdoc/cljdoc/pulls/173","id":224487961,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI0NDg3OTYx","html_url":"https://github.com/cljdoc/cljdoc/pull/173","diff_url":"https://github.com/cljdoc/cljdoc/pull/173.diff","patch_url":"https://github.com/cljdoc/cljdoc/pull/173.patch","issue_url":"https://api.github.com/repos/cljdoc/cljdoc/issues/173","number":173,"state":"open","locked":false,"title":"Add recent build analytics","user":{"login":"avichalp","id":5305984,"node_id":"MDQ6VXNlcjUzMDU5ODQ=","avatar_url":"https://avatars0.githubusercontent.com/u/5305984?v=4","gravatar_id":"","url":"https://api.github.com/users/avichalp","html_url":"https://github.com/avichalp","followers_url":"https://api.github.com/users/avichalp/followers","following_url":"https://api.github.com/users/avichalp/following{/other_user}","gists_url":"https://api.github.com/users/avichalp/gists{/gist_id}","starred_url":"https://api.github.com/users/avichalp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avichalp/subscriptions","organizations_url":"https://api.github.com/users/avichalp/orgs","repos_url":"https://api.github.com/users/avichalp/repos","events_url":"https://api.github.com/users/avichalp/events{/privacy}","received_events_url":"https://api.github.com/users/avichalp/received_events","type":"User","site_admin":false},"body":"Initial attempt at build analytics.\r\n\r\nLooks something like this:\r\n\r\n![screenshot 2018-10-20 at 18 59 47](https://user-images.githubusercontent.com/5305984/47258426-507a1e80-d49b-11e8-86d2-11d4ca0365cf.png)\r\n\r\n![screenshot 2018-10-20 at 19 07 26](https://user-images.githubusercontent.com/5305984/47258445-7e5f6300-d49b-11e8-8cb4-d4f146eacff0.png)\r\n\r\nfixes #150 \r\n","created_at":"2018-10-20T17:10:20Z","updated_at":"2018-10-21T16:33:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2358ed62d6434c6376a17f08e0e77f2b4cbc4d46","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/cljdoc/cljdoc/pulls/173/commits","review_comments_url":"https://api.github.com/repos/cljdoc/cljdoc/pulls/173/comments","review_comment_url":"https://api.github.com/repos/cljdoc/cljdoc/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cljdoc/cljdoc/issues/173/comments","statuses_url":"https://api.github.com/repos/cljdoc/cljdoc/statuses/58abede8afdb446b360fe896e5469615a76c65dc","head":{"label":"avichalp:build-analytics","ref":"build-analytics","sha":"58abede8afdb446b360fe896e5469615a76c65dc","user":{"login":"avichalp","id":5305984,"node_id":"MDQ6VXNlcjUzMDU5ODQ=","avatar_url":"https://avatars0.githubusercontent.com/u/5305984?v=4","gravatar_id":"","url":"https://api.github.com/users/avichalp","html_url":"https://github.com/avichalp","followers_url":"https://api.github.com/users/avichalp/followers","following_url":"https://api.github.com/users/avichalp/following{/other_user}","gists_url":"https://api.github.com/users/avichalp/gists{/gist_id}","starred_url":"https://api.github.com/users/avichalp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avichalp/subscriptions","organizations_url":"https://api.github.com/users/avichalp/orgs","repos_url":"https://api.github.com/users/avichalp/repos","events_url":"https://api.github.com/users/avichalp/events{/privacy}","received_events_url":"https://api.github.com/users/avichalp/received_events","type":"User","site_admin":false},"repo":{"id":151788696,"node_id":"MDEwOlJlcG9zaXRvcnkxNTE3ODg2OTY=","name":"cljdoc","full_name":"avichalp/cljdoc","private":false,"owner":{"login":"avichalp","id":5305984,"node_id":"MDQ6VXNlcjUzMDU5ODQ=","avatar_url":"https://avatars0.githubusercontent.com/u/5305984?v=4","gravatar_id":"","url":"https://api.github.com/users/avichalp","html_url":"https://github.com/avichalp","followers_url":"https://api.github.com/users/avichalp/followers","following_url":"https://api.github.com/users/avichalp/following{/other_user}","gists_url":"https://api.github.com/users/avichalp/gists{/gist_id}","starred_url":"https://api.github.com/users/avichalp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avichalp/subscriptions","organizations_url":"https://api.github.com/users/avichalp/orgs","repos_url":"https://api.github.com/users/avichalp/repos","events_url":"https://api.github.com/users/avichalp/events{/privacy}","received_events_url":"https://api.github.com/users/avichalp/received_events","type":"User","site_admin":false},"html_url":"https://github.com/avichalp/cljdoc","description":"A central documentation hub for the Clojure community 🙌","fork":true,"url":"https://api.github.com/repos/avichalp/cljdoc","forks_url":"https://api.github.com/repos/avichalp/cljdoc/forks","keys_url":"https://api.github.com/repos/avichalp/cljdoc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/avichalp/cljdoc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/avichalp/cljdoc/teams","hooks_url":"https://api.github.com/repos/avichalp/cljdoc/hooks","issue_events_url":"https://api.github.com/repos/avichalp/cljdoc/issues/events{/number}","events_url":"https://api.github.com/repos/avichalp/cljdoc/events","assignees_url":"https://api.github.com/repos/avichalp/cljdoc/assignees{/user}","branches_url":"https://api.github.com/repos/avichalp/cljdoc/branches{/branch}","tags_url":"https://api.github.com/repos/avichalp/cljdoc/tags","blobs_url":"https://api.github.com/repos/avichalp/cljdoc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/avichalp/cljdoc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/avichalp/cljdoc/git/refs{/sha}","trees_url":"https://api.github.com/repos/avichalp/cljdoc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/avichalp/cljdoc/statuses/{sha}","languages_url":"https://api.github.com/repos/avichalp/cljdoc/languages","stargazers_url":"https://api.github.com/repos/avichalp/cljdoc/stargazers","contributors_url":"https://api.github.com/repos/avichalp/cljdoc/contributors","subscribers_url":"https://api.github.com/repos/avichalp/cljdoc/subscribers","subscription_url":"https://api.github.com/repos/avichalp/cljdoc/subscription","commits_url":"https://api.github.com/repos/avichalp/cljdoc/commits{/sha}","git_commits_url":"https://api.github.com/repos/avichalp/cljdoc/git/commits{/sha}","comments_url":"https://api.github.com/repos/avichalp/cljdoc/comments{/number}","issue_comment_url":"https://api.github.com/repos/avichalp/cljdoc/issues/comments{/number}","contents_url":"https://api.github.com/repos/avichalp/cljdoc/contents/{+path}","compare_url":"https://api.github.com/repos/avichalp/cljdoc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/avichalp/cljdoc/merges","archive_url":"https://api.github.com/repos/avichalp/cljdoc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/avichalp/cljdoc/downloads","issues_url":"https://api.github.com/repos/avichalp/cljdoc/issues{/number}","pulls_url":"https://api.github.com/repos/avichalp/cljdoc/pulls{/number}","milestones_url":"https://api.github.com/repos/avichalp/cljdoc/milestones{/number}","notifications_url":"https://api.github.com/repos/avichalp/cljdoc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/avichalp/cljdoc/labels{/name}","releases_url":"https://api.github.com/repos/avichalp/cljdoc/releases{/id}","deployments_url":"https://api.github.com/repos/avichalp/cljdoc/deployments","created_at":"2018-10-05T23:37:46Z","updated_at":"2018-10-05T23:37:48Z","pushed_at":"2018-10-21T16:19:31Z","git_url":"git://github.com/avichalp/cljdoc.git","ssh_url":"git@github.com:avichalp/cljdoc.git","clone_url":"https://github.com/avichalp/cljdoc.git","svn_url":"https://github.com/avichalp/cljdoc","homepage":"https://cljdoc.xyz","size":1702,"stargazers_count":0,"watchers_count":0,"language":"Clojure","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"epl-2.0","name":"Eclipse Public License 2.0","spdx_id":"EPL-2.0","url":"https://api.github.com/licenses/epl-2.0","node_id":"MDc6TGljZW5zZTMy"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"cljdoc:master","ref":"master","sha":"460365c68e46109bd3490175cf815ee439636fbc","user":{"login":"cljdoc","id":40694562,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQwNjk0NTYy","avatar_url":"https://avatars3.githubusercontent.com/u/40694562?v=4","gravatar_id":"","url":"https://api.github.com/users/cljdoc","html_url":"https://github.com/cljdoc","followers_url":"https://api.github.com/users/cljdoc/followers","following_url":"https://api.github.com/users/cljdoc/following{/other_user}","gists_url":"https://api.github.com/users/cljdoc/gists{/gist_id}","starred_url":"https://api.github.com/users/cljdoc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cljdoc/subscriptions","organizations_url":"https://api.github.com/users/cljdoc/orgs","repos_url":"https://api.github.com/users/cljdoc/repos","events_url":"https://api.github.com/users/cljdoc/events{/privacy}","received_events_url":"https://api.github.com/users/cljdoc/received_events","type":"Organization","site_admin":false},"repo":{"id":116408795,"node_id":"MDEwOlJlcG9zaXRvcnkxMTY0MDg3OTU=","name":"cljdoc","full_name":"cljdoc/cljdoc","private":false,"owner":{"login":"cljdoc","id":40694562,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQwNjk0NTYy","avatar_url":"https://avatars3.githubusercontent.com/u/40694562?v=4","gravatar_id":"","url":"https://api.github.com/users/cljdoc","html_url":"https://github.com/cljdoc","followers_url":"https://api.github.com/users/cljdoc/followers","following_url":"https://api.github.com/users/cljdoc/following{/other_user}","gists_url":"https://api.github.com/users/cljdoc/gists{/gist_id}","starred_url":"https://api.github.com/users/cljdoc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cljdoc/subscriptions","organizations_url":"https://api.github.com/users/cljdoc/orgs","repos_url":"https://api.github.com/users/cljdoc/repos","events_url":"https://api.github.com/users/cljdoc/events{/privacy}","received_events_url":"https://api.github.com/users/cljdoc/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/cljdoc/cljdoc","description":"A central documentation hub for the Clojure community 🙌","fork":false,"url":"https://api.github.com/repos/cljdoc/cljdoc","forks_url":"https://api.github.com/repos/cljdoc/cljdoc/forks","keys_url":"https://api.github.com/repos/cljdoc/cljdoc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cljdoc/cljdoc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cljdoc/cljdoc/teams","hooks_url":"https://api.github.com/repos/cljdoc/cljdoc/hooks","issue_events_url":"https://api.github.com/repos/cljdoc/cljdoc/issues/events{/number}","events_url":"https://api.github.com/repos/cljdoc/cljdoc/events","assignees_url":"https://api.github.com/repos/cljdoc/cljdoc/assignees{/user}","branches_url":"https://api.github.com/repos/cljdoc/cljdoc/branches{/branch}","tags_url":"https://api.github.com/repos/cljdoc/cljdoc/tags","blobs_url":"https://api.github.com/repos/cljdoc/cljdoc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cljdoc/cljdoc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cljdoc/cljdoc/git/refs{/sha}","trees_url":"https://api.github.com/repos/cljdoc/cljdoc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cljdoc/cljdoc/statuses/{sha}","languages_url":"https://api.github.com/repos/cljdoc/cljdoc/languages","stargazers_url":"https://api.github.com/repos/cljdoc/cljdoc/stargazers","contributors_url":"https://api.github.com/repos/cljdoc/cljdoc/contributors","subscribers_url":"https://api.github.com/repos/cljdoc/cljdoc/subscribers","subscription_url":"https://api.github.com/repos/cljdoc/cljdoc/subscription","commits_url":"https://api.github.com/repos/cljdoc/cljdoc/commits{/sha}","git_commits_url":"https://api.github.com/repos/cljdoc/cljdoc/git/commits{/sha}","comments_url":"https://api.github.com/repos/cljdoc/cljdoc/comments{/number}","issue_comment_url":"https://api.github.com/repos/cljdoc/cljdoc/issues/comments{/number}","contents_url":"https://api.github.com/repos/cljdoc/cljdoc/contents/{+path}","compare_url":"https://api.github.com/repos/cljdoc/cljdoc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cljdoc/cljdoc/merges","archive_url":"https://api.github.com/repos/cljdoc/cljdoc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cljdoc/cljdoc/downloads","issues_url":"https://api.github.com/repos/cljdoc/cljdoc/issues{/number}","pulls_url":"https://api.github.com/repos/cljdoc/cljdoc/pulls{/number}","milestones_url":"https://api.github.com/repos/cljdoc/cljdoc/milestones{/number}","notifications_url":"https://api.github.com/repos/cljdoc/cljdoc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cljdoc/cljdoc/labels{/name}","releases_url":"https://api.github.com/repos/cljdoc/cljdoc/releases{/id}","deployments_url":"https://api.github.com/repos/cljdoc/cljdoc/deployments","created_at":"2018-01-05T17:14:04Z","updated_at":"2018-10-21T16:07:45Z","pushed_at":"2018-10-21T16:19:32Z","git_url":"git://github.com/cljdoc/cljdoc.git","ssh_url":"git@github.com:cljdoc/cljdoc.git","clone_url":"https://github.com/cljdoc/cljdoc.git","svn_url":"https://github.com/cljdoc/cljdoc","homepage":"https://cljdoc.xyz","size":1721,"stargazers_count":234,"watchers_count":234,"language":"Clojure","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":40,"mirror_url":null,"archived":false,"open_issues_count":46,"license":{"key":"epl-2.0","name":"Eclipse Public License 2.0","spdx_id":"EPL-2.0","url":"https://api.github.com/licenses/epl-2.0","node_id":"MDc6TGljZW5zZTMy"},"forks":40,"open_issues":46,"watchers":234,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cljdoc/cljdoc/pulls/173"},"html":{"href":"https://github.com/cljdoc/cljdoc/pull/173"},"issue":{"href":"https://api.github.com/repos/cljdoc/cljdoc/issues/173"},"comments":{"href":"https://api.github.com/repos/cljdoc/cljdoc/issues/173/comments"},"review_comments":{"href":"https://api.github.com/repos/cljdoc/cljdoc/pulls/173/comments"},"review_comment":{"href":"https://api.github.com/repos/cljdoc/cljdoc/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cljdoc/cljdoc/pulls/173/commits"},"statuses":{"href":"https://api.github.com/repos/cljdoc/cljdoc/statuses/58abede8afdb446b360fe896e5469615a76c65dc"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"martinklepsch"}}