{"action":"created","comment":{"url":"https://api.github.com/repos/storaged-project/libblockdev/pulls/comments/204728227","pull_request_review_id":139856362,"id":204728227,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNDcyODIyNw==","diff_hunk":"@@ -277,6 +278,20 @@ def test_grow_physical(self):\n         self.assertEqual(info_before.logical_size, info_after.logical_size)\n         self.assertGreater(info_after.physical_size, info_before.physical_size)\n \n+    def test_statistics(self):\n+        \"\"\"Verify that it is possible to retrieve statistics of an existing VDO volume\"\"\"\n+\n+        ret = BlockDev.vdo_create(self.vdo_name, self.loop_dev)\n+        self.addCleanup(self._remove_vdo, self.vdo_name)\n+        self.assertTrue(ret)\n+\n+        with six.assertRaisesRegex(self, GLib.GError, \"No such file or directory\"):\n+            stats = BlockDev.vdo_get_statistics(\"nonexistingxxx\")\n+\n+        stats = BlockDev.vdo_get_statistics(self.vdo_name)\n+        self.assertIsNotNone(stats)\n+        self.assertGreater(len(stats), 0)\n+","path":"tests/vdo_test.py","position":25,"original_position":25,"commit_id":"208c5886b487bef1fe36fe2668923844b209dab5","original_commit_id":"208c5886b487bef1fe36fe2668923844b209dab5","user":{"login":"vojtechtrefny","id":5063197,"node_id":"MDQ6VXNlcjUwNjMxOTc=","avatar_url":"https://avatars0.githubusercontent.com/u/5063197?v=4","gravatar_id":"","url":"https://api.github.com/users/vojtechtrefny","html_url":"https://github.com/vojtechtrefny","followers_url":"https://api.github.com/users/vojtechtrefny/followers","following_url":"https://api.github.com/users/vojtechtrefny/following{/other_user}","gists_url":"https://api.github.com/users/vojtechtrefny/gists{/gist_id}","starred_url":"https://api.github.com/users/vojtechtrefny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vojtechtrefny/subscriptions","organizations_url":"https://api.github.com/users/vojtechtrefny/orgs","repos_url":"https://api.github.com/users/vojtechtrefny/repos","events_url":"https://api.github.com/users/vojtechtrefny/events{/privacy}","received_events_url":"https://api.github.com/users/vojtechtrefny/received_events","type":"User","site_admin":false},"body":"We should check at least some of the returned data to be sure it is the same what vdo tools report.","created_at":"2018-07-24T12:08:53Z","updated_at":"2018-07-24T12:20:31Z","html_url":"https://github.com/storaged-project/libblockdev/pull/372#discussion_r204728227","pull_request_url":"https://api.github.com/repos/storaged-project/libblockdev/pulls/372","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/storaged-project/libblockdev/pulls/comments/204728227"},"html":{"href":"https://github.com/storaged-project/libblockdev/pull/372#discussion_r204728227"},"pull_request":{"href":"https://api.github.com/repos/storaged-project/libblockdev/pulls/372"}}},"pull_request":{"url":"https://api.github.com/repos/storaged-project/libblockdev/pulls/372","id":202307910,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAyMzA3OTEw","html_url":"https://github.com/storaged-project/libblockdev/pull/372","diff_url":"https://github.com/storaged-project/libblockdev/pull/372.diff","patch_url":"https://github.com/storaged-project/libblockdev/pull/372.patch","issue_url":"https://api.github.com/repos/storaged-project/libblockdev/issues/372","number":372,"state":"open","locked":false,"title":"vdo: Implement bd_vdo_get_statistics()","user":{"login":"tbzatek","id":7337582,"node_id":"MDQ6VXNlcjczMzc1ODI=","avatar_url":"https://avatars1.githubusercontent.com/u/7337582?v=4","gravatar_id":"","url":"https://api.github.com/users/tbzatek","html_url":"https://github.com/tbzatek","followers_url":"https://api.github.com/users/tbzatek/followers","following_url":"https://api.github.com/users/tbzatek/following{/other_user}","gists_url":"https://api.github.com/users/tbzatek/gists{/gist_id}","starred_url":"https://api.github.com/users/tbzatek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tbzatek/subscriptions","organizations_url":"https://api.github.com/users/tbzatek/orgs","repos_url":"https://api.github.com/users/tbzatek/repos","events_url":"https://api.github.com/users/tbzatek/events{/privacy}","received_events_url":"https://api.github.com/users/tbzatek/received_events","type":"User","site_admin":false},"body":"This exposes statistics of the specified VDO volume. Instead of calling either\r\n`vdostats` or `vdo info` whose output keys are human-readable strings with\r\nno stability guarantees the statistics are actually taken from /sys/kvdo structure\r\nwhich seems to be reasonably stable.\r\n\r\nThere are some keys that are computed by the vdo tools from existing values\r\nso those are backported.\r\n\r\nThe fact that no calls to the vdo tools are involved makes this function suitable\r\nfor reuse within potential VDO support integration in the LVM module. Also since\r\nthere's no real I/O involved this function should be reasonably fast.","created_at":"2018-07-18T16:17:30Z","updated_at":"2018-07-24T12:20:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ea849cfc90e3716657d5e2c00d4d456839f1379e","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/storaged-project/libblockdev/pulls/372/commits","review_comments_url":"https://api.github.com/repos/storaged-project/libblockdev/pulls/372/comments","review_comment_url":"https://api.github.com/repos/storaged-project/libblockdev/pulls/comments{/number}","comments_url":"https://api.github.com/repos/storaged-project/libblockdev/issues/372/comments","statuses_url":"https://api.github.com/repos/storaged-project/libblockdev/statuses/208c5886b487bef1fe36fe2668923844b209dab5","head":{"label":"tbzatek:vdo-statistics","ref":"vdo-statistics","sha":"208c5886b487bef1fe36fe2668923844b209dab5","user":{"login":"tbzatek","id":7337582,"node_id":"MDQ6VXNlcjczMzc1ODI=","avatar_url":"https://avatars1.githubusercontent.com/u/7337582?v=4","gravatar_id":"","url":"https://api.github.com/users/tbzatek","html_url":"https://github.com/tbzatek","followers_url":"https://api.github.com/users/tbzatek/followers","following_url":"https://api.github.com/users/tbzatek/following{/other_user}","gists_url":"https://api.github.com/users/tbzatek/gists{/gist_id}","starred_url":"https://api.github.com/users/tbzatek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tbzatek/subscriptions","organizations_url":"https://api.github.com/users/tbzatek/orgs","repos_url":"https://api.github.com/users/tbzatek/repos","events_url":"https://api.github.com/users/tbzatek/events{/privacy}","received_events_url":"https://api.github.com/users/tbzatek/received_events","type":"User","site_admin":false},"repo":{"id":132775137,"node_id":"MDEwOlJlcG9zaXRvcnkxMzI3NzUxMzc=","name":"libblockdev","full_name":"tbzatek/libblockdev","owner":{"login":"tbzatek","id":7337582,"node_id":"MDQ6VXNlcjczMzc1ODI=","avatar_url":"https://avatars1.githubusercontent.com/u/7337582?v=4","gravatar_id":"","url":"https://api.github.com/users/tbzatek","html_url":"https://github.com/tbzatek","followers_url":"https://api.github.com/users/tbzatek/followers","following_url":"https://api.github.com/users/tbzatek/following{/other_user}","gists_url":"https://api.github.com/users/tbzatek/gists{/gist_id}","starred_url":"https://api.github.com/users/tbzatek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tbzatek/subscriptions","organizations_url":"https://api.github.com/users/tbzatek/orgs","repos_url":"https://api.github.com/users/tbzatek/repos","events_url":"https://api.github.com/users/tbzatek/events{/privacy}","received_events_url":"https://api.github.com/users/tbzatek/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tbzatek/libblockdev","description":"A library for manipulating block devices. ","fork":true,"url":"https://api.github.com/repos/tbzatek/libblockdev","forks_url":"https://api.github.com/repos/tbzatek/libblockdev/forks","keys_url":"https://api.github.com/repos/tbzatek/libblockdev/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tbzatek/libblockdev/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tbzatek/libblockdev/teams","hooks_url":"https://api.github.com/repos/tbzatek/libblockdev/hooks","issue_events_url":"https://api.github.com/repos/tbzatek/libblockdev/issues/events{/number}","events_url":"https://api.github.com/repos/tbzatek/libblockdev/events","assignees_url":"https://api.github.com/repos/tbzatek/libblockdev/assignees{/user}","branches_url":"https://api.github.com/repos/tbzatek/libblockdev/branches{/branch}","tags_url":"https://api.github.com/repos/tbzatek/libblockdev/tags","blobs_url":"https://api.github.com/repos/tbzatek/libblockdev/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tbzatek/libblockdev/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tbzatek/libblockdev/git/refs{/sha}","trees_url":"https://api.github.com/repos/tbzatek/libblockdev/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tbzatek/libblockdev/statuses/{sha}","languages_url":"https://api.github.com/repos/tbzatek/libblockdev/languages","stargazers_url":"https://api.github.com/repos/tbzatek/libblockdev/stargazers","contributors_url":"https://api.github.com/repos/tbzatek/libblockdev/contributors","subscribers_url":"https://api.github.com/repos/tbzatek/libblockdev/subscribers","subscription_url":"https://api.github.com/repos/tbzatek/libblockdev/subscription","commits_url":"https://api.github.com/repos/tbzatek/libblockdev/commits{/sha}","git_commits_url":"https://api.github.com/repos/tbzatek/libblockdev/git/commits{/sha}","comments_url":"https://api.github.com/repos/tbzatek/libblockdev/comments{/number}","issue_comment_url":"https://api.github.com/repos/tbzatek/libblockdev/issues/comments{/number}","contents_url":"https://api.github.com/repos/tbzatek/libblockdev/contents/{+path}","compare_url":"https://api.github.com/repos/tbzatek/libblockdev/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tbzatek/libblockdev/merges","archive_url":"https://api.github.com/repos/tbzatek/libblockdev/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tbzatek/libblockdev/downloads","issues_url":"https://api.github.com/repos/tbzatek/libblockdev/issues{/number}","pulls_url":"https://api.github.com/repos/tbzatek/libblockdev/pulls{/number}","milestones_url":"https://api.github.com/repos/tbzatek/libblockdev/milestones{/number}","notifications_url":"https://api.github.com/repos/tbzatek/libblockdev/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tbzatek/libblockdev/labels{/name}","releases_url":"https://api.github.com/repos/tbzatek/libblockdev/releases{/id}","deployments_url":"https://api.github.com/repos/tbzatek/libblockdev/deployments","created_at":"2018-05-09T15:11:43Z","updated_at":"2018-05-09T15:11:45Z","pushed_at":"2018-07-18T16:16:21Z","git_url":"git://github.com/tbzatek/libblockdev.git","ssh_url":"git@github.com:tbzatek/libblockdev.git","clone_url":"https://github.com/tbzatek/libblockdev.git","svn_url":"https://github.com/tbzatek/libblockdev","homepage":"","size":2833,"stargazers_count":0,"watchers_count":0,"language":"C","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":"lgpl-2.1","name":"GNU Lesser General Public License v2.1","spdx_id":"LGPL-2.1","url":"https://api.github.com/licenses/lgpl-2.1","node_id":"MDc6TGljZW5zZTEx"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"storaged-project:master","ref":"master","sha":"cb34172ceeacb46cc4188aaed26988bf0a628307","user":{"login":"storaged-project","id":11505466,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExNTA1NDY2","avatar_url":"https://avatars1.githubusercontent.com/u/11505466?v=4","gravatar_id":"","url":"https://api.github.com/users/storaged-project","html_url":"https://github.com/storaged-project","followers_url":"https://api.github.com/users/storaged-project/followers","following_url":"https://api.github.com/users/storaged-project/following{/other_user}","gists_url":"https://api.github.com/users/storaged-project/gists{/gist_id}","starred_url":"https://api.github.com/users/storaged-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/storaged-project/subscriptions","organizations_url":"https://api.github.com/users/storaged-project/orgs","repos_url":"https://api.github.com/users/storaged-project/repos","events_url":"https://api.github.com/users/storaged-project/events{/privacy}","received_events_url":"https://api.github.com/users/storaged-project/received_events","type":"Organization","site_admin":false},"repo":{"id":19988938,"node_id":"MDEwOlJlcG9zaXRvcnkxOTk4ODkzOA==","name":"libblockdev","full_name":"storaged-project/libblockdev","owner":{"login":"storaged-project","id":11505466,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExNTA1NDY2","avatar_url":"https://avatars1.githubusercontent.com/u/11505466?v=4","gravatar_id":"","url":"https://api.github.com/users/storaged-project","html_url":"https://github.com/storaged-project","followers_url":"https://api.github.com/users/storaged-project/followers","following_url":"https://api.github.com/users/storaged-project/following{/other_user}","gists_url":"https://api.github.com/users/storaged-project/gists{/gist_id}","starred_url":"https://api.github.com/users/storaged-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/storaged-project/subscriptions","organizations_url":"https://api.github.com/users/storaged-project/orgs","repos_url":"https://api.github.com/users/storaged-project/repos","events_url":"https://api.github.com/users/storaged-project/events{/privacy}","received_events_url":"https://api.github.com/users/storaged-project/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/storaged-project/libblockdev","description":"A library for manipulating block devices. ","fork":false,"url":"https://api.github.com/repos/storaged-project/libblockdev","forks_url":"https://api.github.com/repos/storaged-project/libblockdev/forks","keys_url":"https://api.github.com/repos/storaged-project/libblockdev/keys{/key_id}","collaborators_url":"https://api.github.com/repos/storaged-project/libblockdev/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/storaged-project/libblockdev/teams","hooks_url":"https://api.github.com/repos/storaged-project/libblockdev/hooks","issue_events_url":"https://api.github.com/repos/storaged-project/libblockdev/issues/events{/number}","events_url":"https://api.github.com/repos/storaged-project/libblockdev/events","assignees_url":"https://api.github.com/repos/storaged-project/libblockdev/assignees{/user}","branches_url":"https://api.github.com/repos/storaged-project/libblockdev/branches{/branch}","tags_url":"https://api.github.com/repos/storaged-project/libblockdev/tags","blobs_url":"https://api.github.com/repos/storaged-project/libblockdev/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/storaged-project/libblockdev/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/storaged-project/libblockdev/git/refs{/sha}","trees_url":"https://api.github.com/repos/storaged-project/libblockdev/git/trees{/sha}","statuses_url":"https://api.github.com/repos/storaged-project/libblockdev/statuses/{sha}","languages_url":"https://api.github.com/repos/storaged-project/libblockdev/languages","stargazers_url":"https://api.github.com/repos/storaged-project/libblockdev/stargazers","contributors_url":"https://api.github.com/repos/storaged-project/libblockdev/contributors","subscribers_url":"https://api.github.com/repos/storaged-project/libblockdev/subscribers","subscription_url":"https://api.github.com/repos/storaged-project/libblockdev/subscription","commits_url":"https://api.github.com/repos/storaged-project/libblockdev/commits{/sha}","git_commits_url":"https://api.github.com/repos/storaged-project/libblockdev/git/commits{/sha}","comments_url":"https://api.github.com/repos/storaged-project/libblockdev/comments{/number}","issue_comment_url":"https://api.github.com/repos/storaged-project/libblockdev/issues/comments{/number}","contents_url":"https://api.github.com/repos/storaged-project/libblockdev/contents/{+path}","compare_url":"https://api.github.com/repos/storaged-project/libblockdev/compare/{base}...{head}","merges_url":"https://api.github.com/repos/storaged-project/libblockdev/merges","archive_url":"https://api.github.com/repos/storaged-project/libblockdev/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/storaged-project/libblockdev/downloads","issues_url":"https://api.github.com/repos/storaged-project/libblockdev/issues{/number}","pulls_url":"https://api.github.com/repos/storaged-project/libblockdev/pulls{/number}","milestones_url":"https://api.github.com/repos/storaged-project/libblockdev/milestones{/number}","notifications_url":"https://api.github.com/repos/storaged-project/libblockdev/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/storaged-project/libblockdev/labels{/name}","releases_url":"https://api.github.com/repos/storaged-project/libblockdev/releases{/id}","deployments_url":"https://api.github.com/repos/storaged-project/libblockdev/deployments","created_at":"2014-05-20T16:44:55Z","updated_at":"2018-07-19T06:12:44Z","pushed_at":"2018-07-19T06:12:42Z","git_url":"git://github.com/storaged-project/libblockdev.git","ssh_url":"git@github.com:storaged-project/libblockdev.git","clone_url":"https://github.com/storaged-project/libblockdev.git","svn_url":"https://github.com/storaged-project/libblockdev","homepage":"","size":2862,"stargazers_count":32,"watchers_count":32,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":30,"mirror_url":null,"archived":false,"open_issues_count":21,"license":{"key":"lgpl-2.1","name":"GNU Lesser General Public License v2.1","spdx_id":"LGPL-2.1","url":"https://api.github.com/licenses/lgpl-2.1","node_id":"MDc6TGljZW5zZTEx"},"forks":30,"open_issues":21,"watchers":32,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/storaged-project/libblockdev/pulls/372"},"html":{"href":"https://github.com/storaged-project/libblockdev/pull/372"},"issue":{"href":"https://api.github.com/repos/storaged-project/libblockdev/issues/372"},"comments":{"href":"https://api.github.com/repos/storaged-project/libblockdev/issues/372/comments"},"review_comments":{"href":"https://api.github.com/repos/storaged-project/libblockdev/pulls/372/comments"},"review_comment":{"href":"https://api.github.com/repos/storaged-project/libblockdev/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/storaged-project/libblockdev/pulls/372/commits"},"statuses":{"href":"https://api.github.com/repos/storaged-project/libblockdev/statuses/208c5886b487bef1fe36fe2668923844b209dab5"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"vojtechtrefny"}}