payload: {"action":"created","comment":{"url":"https://api.github.com/repos/storj/storj/pulls/comments/295731522","pull_request_review_id":252192724,"id":295731522,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI5NTczMTUyMg==","diff_hunk":"@@ -0,0 +1,100 @@\n+// Copyright (C) 2019 Storj Labs, Inc.\n+// See LICENSE for copying information.\n+\n+package console\n+\n+import (\n+\t\"context\"\n+\t\"time\"\n+\n+\t\"github.com/zeebo/errs\"\n+\t\"go.uber.org/zap\"\n+\n+\t\"storj.io/storj/internal/memory\"\n+\t\"storj.io/storj/pkg/kademlia\"\n+\t\"storj.io/storj/pkg/storj\"\n+\t\"storj.io/storj/storagenode/bandwidth\"\n+\t\"storj.io/storj/storagenode/pieces\"\n+)\n+\n+// Service is handling storage node operator related logic\n+type Service struct {\n+\tlog *zap.Logger\n+\n+\tbandwidth bandwidth.DB\n+\tpieceInfo pieces.DB\n+\tkademlia  *kademlia.Kademlia\n+\n+\tallocatedBandwidth memory.Size\n+\tallocatedDiskSpace memory.Size\n+\twalletNumber       string\n+\tupTime             time.Time\n+}\n+\n+// NewService returns new instance of Service\n+func NewService(log *zap.Logger, bandwidth bandwidth.DB, pieceInfo pieces.DB, kademlia *kademlia.Kademlia,\n+\tallocatedBandwidth, allocatedDiskSpace memory.Size, walletNumber string) (*Service, error) {\n+\tif log == nil {\n+\t\treturn nil, errs.New(\"log can't be nil\")\n+\t}\n+\n+\tif bandwidth == nil {\n+\t\treturn nil, errs.New(\"bandwidth can't be nil\")\n+\t}\n+\n+\tif pieceInfo == nil {\n+\t\treturn nil, errs.New(\"pieceInfo can't be nil\")\n+\t}\n+\n+\tif kademlia == nil {\n+\t\treturn nil, errs.New(\"kademlia can't be nil\")\n+\t}\n+\n+\tservice := Service{\n+\t\tlog:                log,\n+\t\tbandwidth:          bandwidth,\n+\t\tpieceInfo:          pieceInfo,\n+\t\tkademlia:           kademlia,\n+\t\tallocatedBandwidth: allocatedBandwidth,\n+\t\tallocatedDiskSpace: allocatedDiskSpace,\n+\t\twalletNumber:       walletNumber,\n+\t\tupTime:             time.Now(),\n+\t}\n+\n+\treturn &service, nil\n+}\n+\n+// GetUsedBandwidth returns all info about storage node bandwidth usage\n+func (s *Service) GetUsedBandwidth(ctx context.Context) (*BandwidthInfo, error) {\n+\tusage, err := bandwidth.TotalMonthlySummary(ctx, s.bandwidth)\n+\tif err != nil {\n+\t\treturn nil, err\n+\t}\n+\n+\treturn FromUsage(usage, s.allocatedBandwidth.Int64())\n+}\n+\n+// GetUsedStorage returns all info about storagenode disk space usage\n+func (s *Service) GetUsedStorage(ctx context.Context) (*DiskSpaceInfo, error) {\n+\tspaceUsed, err := s.pieceInfo.SpaceUsed(ctx)","path":"storagenode/console/service.go","position":99,"original_position":79,"commit_id":"e8cb68fcecfee7c94e195045acf816891fac7e13","original_commit_id":"feba6767378b83d12fa640e86e01e1f4a56f0f5a","user":{"login":"crawter","id":18460064,"node_id":"MDQ6VXNlcjE4NDYwMDY0","avatar_url":"https://avatars3.githubusercontent.com/u/18460064?v=4","gravatar_id":"","url":"https://api.github.com/users/crawter","html_url":"https://github.com/crawter","followers_url":"https://api.github.com/users/crawter/followers","following_url":"https://api.github.com/users/crawter/following{/other_user}","gists_url":"https://api.github.com/users/crawter/gists{/gist_id}","starred_url":"https://api.github.com/users/crawter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crawter/subscriptions","organizations_url":"https://api.github.com/users/crawter/orgs","repos_url":"https://api.github.com/users/crawter/repos","events_url":"https://api.github.com/users/crawter/events{/privacy}","received_events_url":"https://api.github.com/users/crawter/received_events","type":"User","site_admin":false},"body":"@egonelbre - also storagenode/inspector/inspector.go has such functionality. But, as console/service and monitoring/service they serves for different purposes ","created_at":"2019-06-20T09:51:41Z","updated_at":"2019-06-20T09:51:41Z","html_url":"https://github.com/storj/storj/pull/2112#discussion_r295731522","pull_request_url":"https://api.github.com/repos/storj/storj/pulls/2112","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/storj/storj/pulls/comments/295731522"},"html":{"href":"https://github.com/storj/storj/pull/2112#discussion_r295731522"},"pull_request":{"href":"https://api.github.com/repos/storj/storj/pulls/2112"}},"in_reply_to_id":294837356},"pull_request":{"url":"https://api.github.com/repos/storj/storj/pulls/2112","id":284974511,"node_id":"MDExOlB1bGxSZXF1ZXN0Mjg0OTc0NTEx","html_url":"https://github.com/storj/storj/pull/2112","diff_url":"https://github.com/storj/storj/pull/2112.diff","patch_url":"https://github.com/storj/storj/pull/2112.patch","issue_url":"https://api.github.com/repos/storj/storj/issues/2112","number":2112,"state":"open","locked":false,"title":"V3-1819 Storage node operator server and service started","user":{"login":"crawter","id":18460064,"node_id":"MDQ6VXNlcjE4NDYwMDY0","avatar_url":"https://avatars3.githubusercontent.com/u/18460064?v=4","gravatar_id":"","url":"https://api.github.com/users/crawter","html_url":"https://github.com/crawter","followers_url":"https://api.github.com/users/crawter/followers","following_url":"https://api.github.com/users/crawter/following{/other_user}","gists_url":"https://api.github.com/users/crawter/gists{/gist_id}","starred_url":"https://api.github.com/users/crawter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crawter/subscriptions","organizations_url":"https://api.github.com/users/crawter/orgs","repos_url":"https://api.github.com/users/crawter/repos","events_url":"https://api.github.com/users/crawter/events{/privacy}","received_events_url":"https://api.github.com/users/crawter/received_events","type":"User","site_admin":false},"body":"What: \r\nThis is very initial backend for storagenode operator dashboard (SNOBoard). \r\nThe only thing it does right now - just returning static files with our markup.\r\nAll static files will be included in our binary. To achieve this - we generate this binaries from static files via go-bindata.\r\n\r\nWhy:\r\nWe really need this PR to be reviewed and merged to unblock our frontend developers, that are almost created markup for storagenode operator\r\n\r\nThanks for submitting a PR!\r\n\r\n## Code Review Checklist (to be filled out by reviewer)\r\n - [ ] Does the PR describe what changes are being made?\r\n - [ ] Does the PR describe why the changes are being made?\r\n - [ ] Does the code follow [our style guide](https://github.com/storj/docs/blob/master/code/Style.md)?\r\n - [ ] Does the code follow [our testing guide](https://github.com/storj/docs/blob/master/code/Testing.md)?\r\n - [ ] Could the PR be broken into smaller PRs?\r\n - [ ] Does the new code have enough tests? (*every* PR should have tests or justification otherwise. Bug-fix PRs especially)\r\n - [ ] Does the new code have enough documentation that answers \"how do I use it?\" and \"what does it do?\"? (both source documentation and [higher level](https://github.com/storj/docs), diagrams?)\r\n - [ ] Does any documentation need updating?\r\n","created_at":"2019-06-04T13:29:37Z","updated_at":"2019-06-20T09:51:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fc543742e079245471892bbc636eff35239c71ed","assignee":null,"assignees":[],"requested_reviewers":[{"login":"jtolds","id":109603,"node_id":"MDQ6VXNlcjEwOTYwMw==","avatar_url":"https://avatars0.githubusercontent.com/u/109603?v=4","gravatar_id":"","url":"https://api.github.com/users/jtolds","html_url":"https://github.com/jtolds","followers_url":"https://api.github.com/users/jtolds/followers","following_url":"https://api.github.com/users/jtolds/following{/other_user}","gists_url":"https://api.github.com/users/jtolds/gists{/gist_id}","starred_url":"https://api.github.com/users/jtolds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jtolds/subscriptions","organizations_url":"https://api.github.com/users/jtolds/orgs","repos_url":"https://api.github.com/users/jtolds/repos","events_url":"https://api.github.com/users/jtolds/events{/privacy}","received_events_url":"https://api.github.com/users/jtolds/received_events","type":"User","site_admin":false},{"login":"aleitner","id":7276007,"node_id":"MDQ6VXNlcjcyNzYwMDc=","avatar_url":"https://avatars3.githubusercontent.com/u/7276007?v=4","gravatar_id":"","url":"https://api.github.com/users/aleitner","html_url":"https://github.com/aleitner","followers_url":"https://api.github.com/users/aleitner/followers","following_url":"https://api.github.com/users/aleitner/following{/other_user}","gists_url":"https://api.github.com/users/aleitner/gists{/gist_id}","starred_url":"https://api.github.com/users/aleitner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aleitner/subscriptions","organizations_url":"https://api.github.com/users/aleitner/orgs","repos_url":"https://api.github.com/users/aleitner/repos","events_url":"https://api.github.com/users/aleitner/events{/privacy}","received_events_url":"https://api.github.com/users/aleitner/received_events","type":"User","site_admin":false},{"login":"rikysya","id":17311776,"node_id":"MDQ6VXNlcjE3MzExNzc2","avatar_url":"https://avatars0.githubusercontent.com/u/17311776?v=4","gravatar_id":"","url":"https://api.github.com/users/rikysya","html_url":"https://github.com/rikysya","followers_url":"https://api.github.com/users/rikysya/followers","following_url":"https://api.github.com/users/rikysya/following{/other_user}","gists_url":"https://api.github.com/users/rikysya/gists{/gist_id}","starred_url":"https://api.github.com/users/rikysya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rikysya/subscriptions","organizations_url":"https://api.github.com/users/rikysya/orgs","repos_url":"https://api.github.com/users/rikysya/repos","events_url":"https://api.github.com/users/rikysya/events{/privacy}","received_events_url":"https://api.github.com/users/rikysya/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":1077048580,"node_id":"MDU6TGFiZWwxMDc3MDQ4NTgw","url":"https://api.github.com/repos/storj/storj/labels/Request%20Code%20Review","name":"Request Code Review","color":"80edbf","default":false},{"id":982933521,"node_id":"MDU6TGFiZWw5ODI5MzM1MjE=","url":"https://api.github.com/repos/storj/storj/labels/cla-signed","name":"cla-signed","color":"ededed","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/storj/storj/pulls/2112/commits","review_comments_url":"https://api.github.com/repos/storj/storj/pulls/2112/comments","review_comment_url":"https://api.github.com/repos/storj/storj/pulls/comments{/number}","comments_url":"https://api.github.com/repos/storj/storj/issues/2112/comments","statuses_url":"https://api.github.com/repos/storj/storj/statuses/e8cb68fcecfee7c94e195045acf816891fac7e13","head":{"label":"crawter:node_operator_gui","ref":"node_operator_gui","sha":"e8cb68fcecfee7c94e195045acf816891fac7e13","user":{"login":"crawter","id":18460064,"node_id":"MDQ6VXNlcjE4NDYwMDY0","avatar_url":"https://avatars3.githubusercontent.com/u/18460064?v=4","gravatar_id":"","url":"https://api.github.com/users/crawter","html_url":"https://github.com/crawter","followers_url":"https://api.github.com/users/crawter/followers","following_url":"https://api.github.com/users/crawter/following{/other_user}","gists_url":"https://api.github.com/users/crawter/gists{/gist_id}","starred_url":"https://api.github.com/users/crawter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crawter/subscriptions","organizations_url":"https://api.github.com/users/crawter/orgs","repos_url":"https://api.github.com/users/crawter/repos","events_url":"https://api.github.com/users/crawter/events{/privacy}","received_events_url":"https://api.github.com/users/crawter/received_events","type":"User","site_admin":false},"repo":{"id":141137037,"node_id":"MDEwOlJlcG9zaXRvcnkxNDExMzcwMzc=","name":"storj","full_name":"crawter/storj","private":false,"owner":{"login":"crawter","id":18460064,"node_id":"MDQ6VXNlcjE4NDYwMDY0","avatar_url":"https://avatars3.githubusercontent.com/u/18460064?v=4","gravatar_id":"","url":"https://api.github.com/users/crawter","html_url":"https://github.com/crawter","followers_url":"https://api.github.com/users/crawter/followers","following_url":"https://api.github.com/users/crawter/following{/other_user}","gists_url":"https://api.github.com/users/crawter/gists{/gist_id}","starred_url":"https://api.github.com/users/crawter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crawter/subscriptions","organizations_url":"https://api.github.com/users/crawter/orgs","repos_url":"https://api.github.com/users/crawter/repos","events_url":"https://api.github.com/users/crawter/events{/privacy}","received_events_url":"https://api.github.com/users/crawter/received_events","type":"User","site_admin":false},"html_url":"https://github.com/crawter/storj","description":null,"fork":true,"url":"https://api.github.com/repos/crawter/storj","forks_url":"https://api.github.com/repos/crawter/storj/forks","keys_url":"https://api.github.com/repos/crawter/storj/keys{/key_id}","collaborators_url":"https://api.github.com/repos/crawter/storj/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/crawter/storj/teams","hooks_url":"https://api.github.com/repos/crawter/storj/hooks","issue_events_url":"https://api.github.com/repos/crawter/storj/issues/events{/number}","events_url":"https://api.github.com/repos/crawter/storj/events","assignees_url":"https://api.github.com/repos/crawter/storj/assignees{/user}","branches_url":"https://api.github.com/repos/crawter/storj/branches{/branch}","tags_url":"https://api.github.com/repos/crawter/storj/tags","blobs_url":"https://api.github.com/repos/crawter/storj/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/crawter/storj/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/crawter/storj/git/refs{/sha}","trees_url":"https://api.github.com/repos/crawter/storj/git/trees{/sha}","statuses_url":"https://api.github.com/repos/crawter/storj/statuses/{sha}","languages_url":"https://api.github.com/repos/crawter/storj/languages","stargazers_url":"https://api.github.com/repos/crawter/storj/stargazers","contributors_url":"https://api.github.com/repos/crawter/storj/contributors","subscribers_url":"https://api.github.com/repos/crawter/storj/subscribers","subscription_url":"https://api.github.com/repos/crawter/storj/subscription","commits_url":"https://api.github.com/repos/crawter/storj/commits{/sha}","git_commits_url":"https://api.github.com/repos/crawter/storj/git/commits{/sha}","comments_url":"https://api.github.com/repos/crawter/storj/comments{/number}","issue_comment_url":"https://api.github.com/repos/crawter/storj/issues/comments{/number}","contents_url":"https://api.github.com/repos/crawter/storj/contents/{+path}","compare_url":"https://api.github.com/repos/crawter/storj/compare/{base}...{head}","merges_url":"https://api.github.com/repos/crawter/storj/merges","archive_url":"https://api.github.com/repos/crawter/storj/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/crawter/storj/downloads","issues_url":"https://api.github.com/repos/crawter/storj/issues{/number}","pulls_url":"https://api.github.com/repos/crawter/storj/pulls{/number}","milestones_url":"https://api.github.com/repos/crawter/storj/milestones{/number}","notifications_url":"https://api.github.com/repos/crawter/storj/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/crawter/storj/labels{/name}","releases_url":"https://api.github.com/repos/crawter/storj/releases{/id}","deployments_url":"https://api.github.com/repos/crawter/storj/deployments","created_at":"2018-07-16T12:41:24Z","updated_at":"2018-10-16T11:20:09Z","pushed_at":"2019-06-19T15:40:30Z","git_url":"git://github.com/crawter/storj.git","ssh_url":"git@github.com:crawter/storj.git","clone_url":"https://github.com/crawter/storj.git","svn_url":"https://github.com/crawter/storj","homepage":null,"size":44654,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0","node_id":"MDc6TGljZW5zZTE="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"storj:master","ref":"master","sha":"9d670b33b369e650db602c3415d84d1dab3648e2","user":{"login":"storj","id":6308081,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYzMDgwODE=","avatar_url":"https://avatars3.githubusercontent.com/u/6308081?v=4","gravatar_id":"","url":"https://api.github.com/users/storj","html_url":"https://github.com/storj","followers_url":"https://api.github.com/users/storj/followers","following_url":"https://api.github.com/users/storj/following{/other_user}","gists_url":"https://api.github.com/users/storj/gists{/gist_id}","starred_url":"https://api.github.com/users/storj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/storj/subscriptions","organizations_url":"https://api.github.com/users/storj/orgs","repos_url":"https://api.github.com/users/storj/repos","events_url":"https://api.github.com/users/storj/events{/privacy}","received_events_url":"https://api.github.com/users/storj/received_events","type":"Organization","site_admin":false},"repo":{"id":128089774,"node_id":"MDEwOlJlcG9zaXRvcnkxMjgwODk3NzQ=","name":"storj","full_name":"storj/storj","private":false,"owner":{"login":"storj","id":6308081,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYzMDgwODE=","avatar_url":"https://avatars3.githubusercontent.com/u/6308081?v=4","gravatar_id":"","url":"https://api.github.com/users/storj","html_url":"https://github.com/storj","followers_url":"https://api.github.com/users/storj/followers","following_url":"https://api.github.com/users/storj/following{/other_user}","gists_url":"https://api.github.com/users/storj/gists{/gist_id}","starred_url":"https://api.github.com/users/storj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/storj/subscriptions","organizations_url":"https://api.github.com/users/storj/orgs","repos_url":"https://api.github.com/users/storj/repos","events_url":"https://api.github.com/users/storj/events{/privacy}","received_events_url":"https://api.github.com/users/storj/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/storj/storj","description":"Ongoing Storj v3 development. Decentralized cloud object storage that is affordable, easy to use, private, and secure.","fork":false,"url":"https://api.github.com/repos/storj/storj","forks_url":"https://api.github.com/repos/storj/storj/forks","keys_url":"https://api.github.com/repos/storj/storj/keys{/key_id}","collaborators_url":"https://api.github.com/repos/storj/storj/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/storj/storj/teams","hooks_url":"https://api.github.com/repos/storj/storj/hooks","issue_events_url":"https://api.github.com/repos/storj/storj/issues/events{/number}","events_url":"https://api.github.com/repos/storj/storj/events","assignees_url":"https://api.github.com/repos/storj/storj/assignees{/user}","branches_url":"https://api.github.com/repos/storj/storj/branches{/branch}","tags_url":"https://api.github.com/repos/storj/storj/tags","blobs_url":"https://api.github.com/repos/storj/storj/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/storj/storj/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/storj/storj/git/refs{/sha}","trees_url":"https://api.github.com/repos/storj/storj/git/trees{/sha}","statuses_url":"https://api.github.com/repos/storj/storj/statuses/{sha}","languages_url":"https://api.github.com/repos/storj/storj/languages","stargazers_url":"https://api.github.com/repos/storj/storj/stargazers","contributors_url":"https://api.github.com/repos/storj/storj/contributors","subscribers_url":"https://api.github.com/repos/storj/storj/subscribers","subscription_url":"https://api.github.com/repos/storj/storj/subscription","commits_url":"https://api.github.com/repos/storj/storj/commits{/sha}","git_commits_url":"https://api.github.com/repos/storj/storj/git/commits{/sha}","comments_url":"https://api.github.com/repos/storj/storj/comments{/number}","issue_comment_url":"https://api.github.com/repos/storj/storj/issues/comments{/number}","contents_url":"https://api.github.com/repos/storj/storj/contents/{+path}","compare_url":"https://api.github.com/repos/storj/storj/compare/{base}...{head}","merges_url":"https://api.github.com/repos/storj/storj/merges","archive_url":"https://api.github.com/repos/storj/storj/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/storj/storj/downloads","issues_url":"https://api.github.com/repos/storj/storj/issues{/number}","pulls_url":"https://api.github.com/repos/storj/storj/pulls{/number}","milestones_url":"https://api.github.com/repos/storj/storj/milestones{/number}","notifications_url":"https://api.github.com/repos/storj/storj/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/storj/storj/labels{/name}","releases_url":"https://api.github.com/repos/storj/storj/releases{/id}","deployments_url":"https://api.github.com/repos/storj/storj/deployments","created_at":"2018-04-04T16:27:18Z","updated_at":"2019-06-20T00:45:38Z","pushed_at":"2019-06-20T09:46:14Z","git_url":"git://github.com/storj/storj.git","ssh_url":"git@github.com:storj/storj.git","clone_url":"https://github.com/storj/storj.git","svn_url":"https://github.com/storj/storj","homepage":"https://storj.io","size":83542,"stargazers_count":690,"watchers_count":690,"language":"Go","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":159,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":84,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0","node_id":"MDc6TGljZW5zZTE="},"forks":159,"open_issues":84,"watchers":690,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/storj/storj/pulls/2112"},"html":{"href":"https://github.com/storj/storj/pull/2112"},"issue":{"href":"https://api.github.com/repos/storj/storj/issues/2112"},"comments":{"href":"https://api.github.com/repos/storj/storj/issues/2112/comments"},"review_comments":{"href":"https://api.github.com/repos/storj/storj/pulls/2112/comments"},"review_comment":{"href":"https://api.github.com/repos/storj/storj/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/storj/storj/pulls/2112/commits"},"statuses":{"href":"https://api.github.com/repos/storj/storj/statuses/e8cb68fcecfee7c94e195045acf816891fac7e13"}},"author_association":"CONTRIBUTOR"}}
other: {"actor":{"display_login":"crawter"}}