{"action":"created","comment":{"url":"https://api.github.com/repos/projectbuendia/buendia/pulls/comments/55127815","id":55127815,"diff_hunk":"@@ -0,0 +1,42 @@\n+#!/bin/bash\n+# Copyright 2015 The Project Buendia Authors\n+#\n+# Licensed under the Apache License, Version 2.0 (the \"License\"); you may not\n+# use this file except in compliance with the License.  You may obtain a copy\n+# of the License at: http://www.apache.org/licenses/LICENSE-2.0\n+#\n+# Unless required by applicable law or agreed to in writing, software distrib-\n+# uted under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES\n+# OR CONDITIONS OF ANY KIND, either express or implied.  See the License for\n+# specific language governing permissions and limitations under the License.\n+\n+up_count=$(cat /var/log/buendia/buendia-warmup.log | grep '(end, status 0)' | wc -l)\n+down_count=$(cat /var/log/buendia/buendia-warmup.log | grep '(end, status 1)' | wc -l)\n+downtimes=$(cat /var/log/buendia/buendia-warmup.log | grep '(end, status 1)' | sed -e 's/:[0-9][0-9]\\W*[0-9]*> .*/<br\\/>/')\n+\n+# I would just use bc but it's not installed on Debian so we're constrained to integer arithmetic","path":"packages/buendia-dashboard/data/usr/share/buendia/dashboard/downtime","position":17,"original_position":17,"commit_id":"d0abeadee5d3844b1f28d02e943c561b1c6cd2af","original_commit_id":"d0abeadee5d3844b1f28d02e943c561b1c6cd2af","user":{"login":"capnfabs","id":1336508,"avatar_url":"https://avatars.githubusercontent.com/u/1336508?v=3","gravatar_id":"","url":"https://api.github.com/users/capnfabs","html_url":"https://github.com/capnfabs","followers_url":"https://api.github.com/users/capnfabs/followers","following_url":"https://api.github.com/users/capnfabs/following{/other_user}","gists_url":"https://api.github.com/users/capnfabs/gists{/gist_id}","starred_url":"https://api.github.com/users/capnfabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/capnfabs/subscriptions","organizations_url":"https://api.github.com/users/capnfabs/orgs","repos_url":"https://api.github.com/users/capnfabs/repos","events_url":"https://api.github.com/users/capnfabs/events{/privacy}","received_events_url":"https://api.github.com/users/capnfabs/received_events","type":"User","site_admin":false},"body":"You can install `bc` if you want. If you don't want to, a better comment would be \"It's not worth installing `bc` just for this calculation so we constrain this calculation to integer arithmetic\".","created_at":"2016-03-05T20:56:15Z","updated_at":"2016-03-05T20:56:15Z","html_url":"https://github.com/projectbuendia/buendia/pull/90#discussion_r55127815","pull_request_url":"https://api.github.com/repos/projectbuendia/buendia/pulls/90","_links":{"self":{"href":"https://api.github.com/repos/projectbuendia/buendia/pulls/comments/55127815"},"html":{"href":"https://github.com/projectbuendia/buendia/pull/90#discussion_r55127815"},"pull_request":{"href":"https://api.github.com/repos/projectbuendia/buendia/pulls/90"}}},"pull_request":{"url":"https://api.github.com/repos/projectbuendia/buendia/pulls/90","id":60055394,"html_url":"https://github.com/projectbuendia/buendia/pull/90","diff_url":"https://github.com/projectbuendia/buendia/pull/90.diff","patch_url":"https://github.com/projectbuendia/buendia/pull/90.patch","issue_url":"https://api.github.com/repos/projectbuendia/buendia/issues/90","number":90,"state":"open","locked":false,"title":"Add stats for pilot","user":{"login":"dancunningham","id":961528,"avatar_url":"https://avatars.githubusercontent.com/u/961528?v=3","gravatar_id":"","url":"https://api.github.com/users/dancunningham","html_url":"https://github.com/dancunningham","followers_url":"https://api.github.com/users/dancunningham/followers","following_url":"https://api.github.com/users/dancunningham/following{/other_user}","gists_url":"https://api.github.com/users/dancunningham/gists{/gist_id}","starred_url":"https://api.github.com/users/dancunningham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dancunningham/subscriptions","organizations_url":"https://api.github.com/users/dancunningham/orgs","repos_url":"https://api.github.com/users/dancunningham/repos","events_url":"https://api.github.com/users/dancunningham/events{/privacy}","received_events_url":"https://api.github.com/users/dancunningham/received_events","type":"User","site_admin":false},"body":"Adds some additional tools to the \"dashboard\" for the pilot team to use:\r\n\r\n* Soft shutdown link\r\n* Uptime stats and downtime report\r\n* Backup and restore status page (including USB stick status)\r\n\r\nTo deploy this on a live server, all the files need to be put in place in Debian and then the commands in /packages/buendia-utils/control/postinst need to be run.\r\n\r\nAlternatively, you could build new versions of the buendia-dashboard and buendia-utils packages and let the autoupdate script install those from USB.","created_at":"2016-02-20T18:07:03Z","updated_at":"2016-03-05T20:56:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"21489023e62efbfce36f85d5dcce2ef14a6fed13","assignee":{"login":"capnfabs","id":1336508,"avatar_url":"https://avatars.githubusercontent.com/u/1336508?v=3","gravatar_id":"","url":"https://api.github.com/users/capnfabs","html_url":"https://github.com/capnfabs","followers_url":"https://api.github.com/users/capnfabs/followers","following_url":"https://api.github.com/users/capnfabs/following{/other_user}","gists_url":"https://api.github.com/users/capnfabs/gists{/gist_id}","starred_url":"https://api.github.com/users/capnfabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/capnfabs/subscriptions","organizations_url":"https://api.github.com/users/capnfabs/orgs","repos_url":"https://api.github.com/users/capnfabs/repos","events_url":"https://api.github.com/users/capnfabs/events{/privacy}","received_events_url":"https://api.github.com/users/capnfabs/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/projectbuendia/buendia/pulls/90/commits","review_comments_url":"https://api.github.com/repos/projectbuendia/buendia/pulls/90/comments","review_comment_url":"https://api.github.com/repos/projectbuendia/buendia/pulls/comments{/number}","comments_url":"https://api.github.com/repos/projectbuendia/buendia/issues/90/comments","statuses_url":"https://api.github.com/repos/projectbuendia/buendia/statuses/d0abeadee5d3844b1f28d02e943c561b1c6cd2af","head":{"label":"projectbuendia:feature/dan-stats","ref":"feature/dan-stats","sha":"d0abeadee5d3844b1f28d02e943c561b1c6cd2af","user":{"login":"projectbuendia","id":13339011,"avatar_url":"https://avatars.githubusercontent.com/u/13339011?v=3","gravatar_id":"","url":"https://api.github.com/users/projectbuendia","html_url":"https://github.com/projectbuendia","followers_url":"https://api.github.com/users/projectbuendia/followers","following_url":"https://api.github.com/users/projectbuendia/following{/other_user}","gists_url":"https://api.github.com/users/projectbuendia/gists{/gist_id}","starred_url":"https://api.github.com/users/projectbuendia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projectbuendia/subscriptions","organizations_url":"https://api.github.com/users/projectbuendia/orgs","repos_url":"https://api.github.com/users/projectbuendia/repos","events_url":"https://api.github.com/users/projectbuendia/events{/privacy}","received_events_url":"https://api.github.com/users/projectbuendia/received_events","type":"Organization","site_admin":false},"repo":{"id":30520538,"name":"buendia","full_name":"projectbuendia/buendia","owner":{"login":"projectbuendia","id":13339011,"avatar_url":"https://avatars.githubusercontent.com/u/13339011?v=3","gravatar_id":"","url":"https://api.github.com/users/projectbuendia","html_url":"https://github.com/projectbuendia","followers_url":"https://api.github.com/users/projectbuendia/followers","following_url":"https://api.github.com/users/projectbuendia/following{/other_user}","gists_url":"https://api.github.com/users/projectbuendia/gists{/gist_id}","starred_url":"https://api.github.com/users/projectbuendia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projectbuendia/subscriptions","organizations_url":"https://api.github.com/users/projectbuendia/orgs","repos_url":"https://api.github.com/users/projectbuendia/repos","events_url":"https://api.github.com/users/projectbuendia/events{/privacy}","received_events_url":"https://api.github.com/users/projectbuendia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/projectbuendia/buendia","description":"Main project repository (see the Wiki for details)","fork":false,"url":"https://api.github.com/repos/projectbuendia/buendia","forks_url":"https://api.github.com/repos/projectbuendia/buendia/forks","keys_url":"https://api.github.com/repos/projectbuendia/buendia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/projectbuendia/buendia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/projectbuendia/buendia/teams","hooks_url":"https://api.github.com/repos/projectbuendia/buendia/hooks","issue_events_url":"https://api.github.com/repos/projectbuendia/buendia/issues/events{/number}","events_url":"https://api.github.com/repos/projectbuendia/buendia/events","assignees_url":"https://api.github.com/repos/projectbuendia/buendia/assignees{/user}","branches_url":"https://api.github.com/repos/projectbuendia/buendia/branches{/branch}","tags_url":"https://api.github.com/repos/projectbuendia/buendia/tags","blobs_url":"https://api.github.com/repos/projectbuendia/buendia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/projectbuendia/buendia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/projectbuendia/buendia/git/refs{/sha}","trees_url":"https://api.github.com/repos/projectbuendia/buendia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/projectbuendia/buendia/statuses/{sha}","languages_url":"https://api.github.com/repos/projectbuendia/buendia/languages","stargazers_url":"https://api.github.com/repos/projectbuendia/buendia/stargazers","contributors_url":"https://api.github.com/repos/projectbuendia/buendia/contributors","subscribers_url":"https://api.github.com/repos/projectbuendia/buendia/subscribers","subscription_url":"https://api.github.com/repos/projectbuendia/buendia/subscription","commits_url":"https://api.github.com/repos/projectbuendia/buendia/commits{/sha}","git_commits_url":"https://api.github.com/repos/projectbuendia/buendia/git/commits{/sha}","comments_url":"https://api.github.com/repos/projectbuendia/buendia/comments{/number}","issue_comment_url":"https://api.github.com/repos/projectbuendia/buendia/issues/comments{/number}","contents_url":"https://api.github.com/repos/projectbuendia/buendia/contents/{+path}","compare_url":"https://api.github.com/repos/projectbuendia/buendia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/projectbuendia/buendia/merges","archive_url":"https://api.github.com/repos/projectbuendia/buendia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/projectbuendia/buendia/downloads","issues_url":"https://api.github.com/repos/projectbuendia/buendia/issues{/number}","pulls_url":"https://api.github.com/repos/projectbuendia/buendia/pulls{/number}","milestones_url":"https://api.github.com/repos/projectbuendia/buendia/milestones{/number}","notifications_url":"https://api.github.com/repos/projectbuendia/buendia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/projectbuendia/buendia/labels{/name}","releases_url":"https://api.github.com/repos/projectbuendia/buendia/releases{/id}","deployments_url":"https://api.github.com/repos/projectbuendia/buendia/deployments","created_at":"2015-02-09T05:38:57Z","updated_at":"2016-02-20T18:32:08Z","pushed_at":"2016-03-05T20:36:59Z","git_url":"git://github.com/projectbuendia/buendia.git","ssh_url":"git@github.com:projectbuendia/buendia.git","clone_url":"https://github.com/projectbuendia/buendia.git","svn_url":"https://github.com/projectbuendia/buendia","homepage":"","size":8070,"stargazers_count":106,"watchers_count":106,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":47,"mirror_url":null,"open_issues_count":8,"forks":47,"open_issues":8,"watchers":106,"default_branch":"dev"}},"base":{"label":"projectbuendia:dev","ref":"dev","sha":"393351551d7accde3600f6955dd4acd043b63a8a","user":{"login":"projectbuendia","id":13339011,"avatar_url":"https://avatars.githubusercontent.com/u/13339011?v=3","gravatar_id":"","url":"https://api.github.com/users/projectbuendia","html_url":"https://github.com/projectbuendia","followers_url":"https://api.github.com/users/projectbuendia/followers","following_url":"https://api.github.com/users/projectbuendia/following{/other_user}","gists_url":"https://api.github.com/users/projectbuendia/gists{/gist_id}","starred_url":"https://api.github.com/users/projectbuendia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projectbuendia/subscriptions","organizations_url":"https://api.github.com/users/projectbuendia/orgs","repos_url":"https://api.github.com/users/projectbuendia/repos","events_url":"https://api.github.com/users/projectbuendia/events{/privacy}","received_events_url":"https://api.github.com/users/projectbuendia/received_events","type":"Organization","site_admin":false},"repo":{"id":30520538,"name":"buendia","full_name":"projectbuendia/buendia","owner":{"login":"projectbuendia","id":13339011,"avatar_url":"https://avatars.githubusercontent.com/u/13339011?v=3","gravatar_id":"","url":"https://api.github.com/users/projectbuendia","html_url":"https://github.com/projectbuendia","followers_url":"https://api.github.com/users/projectbuendia/followers","following_url":"https://api.github.com/users/projectbuendia/following{/other_user}","gists_url":"https://api.github.com/users/projectbuendia/gists{/gist_id}","starred_url":"https://api.github.com/users/projectbuendia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projectbuendia/subscriptions","organizations_url":"https://api.github.com/users/projectbuendia/orgs","repos_url":"https://api.github.com/users/projectbuendia/repos","events_url":"https://api.github.com/users/projectbuendia/events{/privacy}","received_events_url":"https://api.github.com/users/projectbuendia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/projectbuendia/buendia","description":"Main project repository (see the Wiki for details)","fork":false,"url":"https://api.github.com/repos/projectbuendia/buendia","forks_url":"https://api.github.com/repos/projectbuendia/buendia/forks","keys_url":"https://api.github.com/repos/projectbuendia/buendia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/projectbuendia/buendia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/projectbuendia/buendia/teams","hooks_url":"https://api.github.com/repos/projectbuendia/buendia/hooks","issue_events_url":"https://api.github.com/repos/projectbuendia/buendia/issues/events{/number}","events_url":"https://api.github.com/repos/projectbuendia/buendia/events","assignees_url":"https://api.github.com/repos/projectbuendia/buendia/assignees{/user}","branches_url":"https://api.github.com/repos/projectbuendia/buendia/branches{/branch}","tags_url":"https://api.github.com/repos/projectbuendia/buendia/tags","blobs_url":"https://api.github.com/repos/projectbuendia/buendia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/projectbuendia/buendia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/projectbuendia/buendia/git/refs{/sha}","trees_url":"https://api.github.com/repos/projectbuendia/buendia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/projectbuendia/buendia/statuses/{sha}","languages_url":"https://api.github.com/repos/projectbuendia/buendia/languages","stargazers_url":"https://api.github.com/repos/projectbuendia/buendia/stargazers","contributors_url":"https://api.github.com/repos/projectbuendia/buendia/contributors","subscribers_url":"https://api.github.com/repos/projectbuendia/buendia/subscribers","subscription_url":"https://api.github.com/repos/projectbuendia/buendia/subscription","commits_url":"https://api.github.com/repos/projectbuendia/buendia/commits{/sha}","git_commits_url":"https://api.github.com/repos/projectbuendia/buendia/git/commits{/sha}","comments_url":"https://api.github.com/repos/projectbuendia/buendia/comments{/number}","issue_comment_url":"https://api.github.com/repos/projectbuendia/buendia/issues/comments{/number}","contents_url":"https://api.github.com/repos/projectbuendia/buendia/contents/{+path}","compare_url":"https://api.github.com/repos/projectbuendia/buendia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/projectbuendia/buendia/merges","archive_url":"https://api.github.com/repos/projectbuendia/buendia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/projectbuendia/buendia/downloads","issues_url":"https://api.github.com/repos/projectbuendia/buendia/issues{/number}","pulls_url":"https://api.github.com/repos/projectbuendia/buendia/pulls{/number}","milestones_url":"https://api.github.com/repos/projectbuendia/buendia/milestones{/number}","notifications_url":"https://api.github.com/repos/projectbuendia/buendia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/projectbuendia/buendia/labels{/name}","releases_url":"https://api.github.com/repos/projectbuendia/buendia/releases{/id}","deployments_url":"https://api.github.com/repos/projectbuendia/buendia/deployments","created_at":"2015-02-09T05:38:57Z","updated_at":"2016-02-20T18:32:08Z","pushed_at":"2016-03-05T20:36:59Z","git_url":"git://github.com/projectbuendia/buendia.git","ssh_url":"git@github.com:projectbuendia/buendia.git","clone_url":"https://github.com/projectbuendia/buendia.git","svn_url":"https://github.com/projectbuendia/buendia","homepage":"","size":8070,"stargazers_count":106,"watchers_count":106,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":47,"mirror_url":null,"open_issues_count":8,"forks":47,"open_issues":8,"watchers":106,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/projectbuendia/buendia/pulls/90"},"html":{"href":"https://github.com/projectbuendia/buendia/pull/90"},"issue":{"href":"https://api.github.com/repos/projectbuendia/buendia/issues/90"},"comments":{"href":"https://api.github.com/repos/projectbuendia/buendia/issues/90/comments"},"review_comments":{"href":"https://api.github.com/repos/projectbuendia/buendia/pulls/90/comments"},"review_comment":{"href":"https://api.github.com/repos/projectbuendia/buendia/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/projectbuendia/buendia/pulls/90/commits"},"statuses":{"href":"https://api.github.com/repos/projectbuendia/buendia/statuses/d0abeadee5d3844b1f28d02e943c561b1c6cd2af"}}}}