{"action":"created","comment":{"url":"https://api.github.com/repos/apache/beam/pulls/comments/159109808","pull_request_review_id":86017207,"id":159109808,"diff_hunk":"@@ -24,11 +24,99 @@\n import math\n import random\n \n+from apache_beam.utils import counters\n from apache_beam.utils.counters import Counter\n+from apache_beam.utils.counters import CounterName\n \n # This module is experimental. No backwards-compatibility guarantees.\n \n \n+class TransformIoCounter(object):\n+  \"\"\"Class to track time and bytes consumed while reading from IO.\n+\n+  Examples of IO can be side inputs, shuffle, or streaming state.\n+  \"\"\"\n+\n+  def check_step(self):\n+    pass\n+\n+  def __exit__(self, exc_type, exc_value, traceback):\n+    pass\n+\n+  def __enter__(self):\n+    pass\n+\n+  def add_bytes_read(self, n):\n+    pass\n+\n+\n+class SideInputReadCounter(TransformIoCounter):\n+  \"\"\"Tracks time and bytes consumed while reading from side inputs.\n+\n+  This class is designed to track consumption of side inputs across fused steps.\n+  We represent a side input as a declaring step, and an input index, which are\n+  represented as an io_target.","path":"sdks/python/apache_beam/runners/worker/opcounters.py","position":35,"original_position":35,"commit_id":"4255543cdc7cfcadd29633f321599d2f591021d8","original_commit_id":"1e64e1f8b880a9fe4450c84cf1c7c5694eb3567e","user":{"login":"pabloem","id":1301740,"avatar_url":"https://avatars2.githubusercontent.com/u/1301740?v=4","gravatar_id":"","url":"https://api.github.com/users/pabloem","html_url":"https://github.com/pabloem","followers_url":"https://api.github.com/users/pabloem/followers","following_url":"https://api.github.com/users/pabloem/following{/other_user}","gists_url":"https://api.github.com/users/pabloem/gists{/gist_id}","starred_url":"https://api.github.com/users/pabloem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pabloem/subscriptions","organizations_url":"https://api.github.com/users/pabloem/orgs","repos_url":"https://api.github.com/users/pabloem/repos","events_url":"https://api.github.com/users/pabloem/events{/privacy}","received_events_url":"https://api.github.com/users/pabloem/received_events","type":"User","site_admin":false},"body":"<!--thread_id:cc_158386099_t; commit:1e64e1f8b880a9fe4450c84cf1c7c5694eb3567e; resolved:0-->\n<!--section:context-quote-->\n> **charlesccychen** wrote:\n> Do we define what we mean by an `io_target` elsewhere?\n> \n> Please add extra newline after paragraph.\n\n<!--section:body-->\nThere's a small comment in counters.py about it. I can improve that if you think it's fitting.","created_at":"2017-12-29T22:58:27Z","updated_at":"2017-12-29T22:58:27Z","html_url":"https://github.com/apache/beam/pull/4248#discussion_r159109808","pull_request_url":"https://api.github.com/repos/apache/beam/pulls/4248","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/apache/beam/pulls/comments/159109808"},"html":{"href":"https://github.com/apache/beam/pull/4248#discussion_r159109808"},"pull_request":{"href":"https://api.github.com/repos/apache/beam/pulls/4248"}}},"pull_request":{"url":"https://api.github.com/repos/apache/beam/pulls/4248","id":157920967,"html_url":"https://github.com/apache/beam/pull/4248","diff_url":"https://github.com/apache/beam/pull/4248.diff","patch_url":"https://github.com/apache/beam/pull/4248.patch","issue_url":"https://api.github.com/repos/apache/beam/issues/4248","number":4248,"state":"open","locked":false,"title":"[BEAM-3042] Tracking of time spent reading side inputs, and bytes read in Dataflow.","user":{"login":"pabloem","id":1301740,"avatar_url":"https://avatars2.githubusercontent.com/u/1301740?v=4","gravatar_id":"","url":"https://api.github.com/users/pabloem","html_url":"https://github.com/pabloem","followers_url":"https://api.github.com/users/pabloem/followers","following_url":"https://api.github.com/users/pabloem/following{/other_user}","gists_url":"https://api.github.com/users/pabloem/gists{/gist_id}","starred_url":"https://api.github.com/users/pabloem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pabloem/subscriptions","organizations_url":"https://api.github.com/users/pabloem/orgs","repos_url":"https://api.github.com/users/pabloem/repos","events_url":"https://api.github.com/users/pabloem/events{/privacy}","received_events_url":"https://api.github.com/users/pabloem/received_events","type":"User","site_admin":false},"body":"This pull request adds changes the PrefetchingSourceReader used to fetch side input data. \r\n\r\nSpecifically, this change helps it track how long was spent blocked waiting to fetch side inputs; and for the Dataflow runner (which uses NativeAvroSource), it also helps track how many bytes were read.","created_at":"2017-12-12T19:43:10Z","updated_at":"2017-12-29T22:58:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"36f36ddbe84f4b6c3e7fca201b8f085a4619ac65","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/beam/pulls/4248/commits","review_comments_url":"https://api.github.com/repos/apache/beam/pulls/4248/comments","review_comment_url":"https://api.github.com/repos/apache/beam/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/beam/issues/4248/comments","statuses_url":"https://api.github.com/repos/apache/beam/statuses/4255543cdc7cfcadd29633f321599d2f591021d8","head":{"label":"pabloem:sideinput-io-tracking","ref":"sideinput-io-tracking","sha":"4255543cdc7cfcadd29633f321599d2f591021d8","user":{"login":"pabloem","id":1301740,"avatar_url":"https://avatars2.githubusercontent.com/u/1301740?v=4","gravatar_id":"","url":"https://api.github.com/users/pabloem","html_url":"https://github.com/pabloem","followers_url":"https://api.github.com/users/pabloem/followers","following_url":"https://api.github.com/users/pabloem/following{/other_user}","gists_url":"https://api.github.com/users/pabloem/gists{/gist_id}","starred_url":"https://api.github.com/users/pabloem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pabloem/subscriptions","organizations_url":"https://api.github.com/users/pabloem/orgs","repos_url":"https://api.github.com/users/pabloem/repos","events_url":"https://api.github.com/users/pabloem/events{/privacy}","received_events_url":"https://api.github.com/users/pabloem/received_events","type":"User","site_admin":false},"repo":{"id":69611732,"name":"incubator-beam","full_name":"pabloem/incubator-beam","owner":{"login":"pabloem","id":1301740,"avatar_url":"https://avatars2.githubusercontent.com/u/1301740?v=4","gravatar_id":"","url":"https://api.github.com/users/pabloem","html_url":"https://github.com/pabloem","followers_url":"https://api.github.com/users/pabloem/followers","following_url":"https://api.github.com/users/pabloem/following{/other_user}","gists_url":"https://api.github.com/users/pabloem/gists{/gist_id}","starred_url":"https://api.github.com/users/pabloem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pabloem/subscriptions","organizations_url":"https://api.github.com/users/pabloem/orgs","repos_url":"https://api.github.com/users/pabloem/repos","events_url":"https://api.github.com/users/pabloem/events{/privacy}","received_events_url":"https://api.github.com/users/pabloem/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pabloem/incubator-beam","description":"Mirror of Apache Beam (Incubating)","fork":true,"url":"https://api.github.com/repos/pabloem/incubator-beam","forks_url":"https://api.github.com/repos/pabloem/incubator-beam/forks","keys_url":"https://api.github.com/repos/pabloem/incubator-beam/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pabloem/incubator-beam/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pabloem/incubator-beam/teams","hooks_url":"https://api.github.com/repos/pabloem/incubator-beam/hooks","issue_events_url":"https://api.github.com/repos/pabloem/incubator-beam/issues/events{/number}","events_url":"https://api.github.com/repos/pabloem/incubator-beam/events","assignees_url":"https://api.github.com/repos/pabloem/incubator-beam/assignees{/user}","branches_url":"https://api.github.com/repos/pabloem/incubator-beam/branches{/branch}","tags_url":"https://api.github.com/repos/pabloem/incubator-beam/tags","blobs_url":"https://api.github.com/repos/pabloem/incubator-beam/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pabloem/incubator-beam/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pabloem/incubator-beam/git/refs{/sha}","trees_url":"https://api.github.com/repos/pabloem/incubator-beam/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pabloem/incubator-beam/statuses/{sha}","languages_url":"https://api.github.com/repos/pabloem/incubator-beam/languages","stargazers_url":"https://api.github.com/repos/pabloem/incubator-beam/stargazers","contributors_url":"https://api.github.com/repos/pabloem/incubator-beam/contributors","subscribers_url":"https://api.github.com/repos/pabloem/incubator-beam/subscribers","subscription_url":"https://api.github.com/repos/pabloem/incubator-beam/subscription","commits_url":"https://api.github.com/repos/pabloem/incubator-beam/commits{/sha}","git_commits_url":"https://api.github.com/repos/pabloem/incubator-beam/git/commits{/sha}","comments_url":"https://api.github.com/repos/pabloem/incubator-beam/comments{/number}","issue_comment_url":"https://api.github.com/repos/pabloem/incubator-beam/issues/comments{/number}","contents_url":"https://api.github.com/repos/pabloem/incubator-beam/contents/{+path}","compare_url":"https://api.github.com/repos/pabloem/incubator-beam/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pabloem/incubator-beam/merges","archive_url":"https://api.github.com/repos/pabloem/incubator-beam/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pabloem/incubator-beam/downloads","issues_url":"https://api.github.com/repos/pabloem/incubator-beam/issues{/number}","pulls_url":"https://api.github.com/repos/pabloem/incubator-beam/pulls{/number}","milestones_url":"https://api.github.com/repos/pabloem/incubator-beam/milestones{/number}","notifications_url":"https://api.github.com/repos/pabloem/incubator-beam/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pabloem/incubator-beam/labels{/name}","releases_url":"https://api.github.com/repos/pabloem/incubator-beam/releases{/id}","deployments_url":"https://api.github.com/repos/pabloem/incubator-beam/deployments","created_at":"2016-09-29T22:05:49Z","updated_at":"2016-09-29T22:05:54Z","pushed_at":"2017-12-20T23:16:39Z","git_url":"git://github.com/pabloem/incubator-beam.git","ssh_url":"git@github.com:pabloem/incubator-beam.git","clone_url":"https://github.com/pabloem/incubator-beam.git","svn_url":"https://github.com/pabloem/incubator-beam","homepage":null,"size":46578,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"68d5926d4421e155fbd7efc4ee18498da11b9b8b","user":{"login":"apache","id":47359,"avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":50904245,"name":"beam","full_name":"apache/beam","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/beam","description":"Apache Beam","fork":false,"url":"https://api.github.com/repos/apache/beam","forks_url":"https://api.github.com/repos/apache/beam/forks","keys_url":"https://api.github.com/repos/apache/beam/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/beam/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/beam/teams","hooks_url":"https://api.github.com/repos/apache/beam/hooks","issue_events_url":"https://api.github.com/repos/apache/beam/issues/events{/number}","events_url":"https://api.github.com/repos/apache/beam/events","assignees_url":"https://api.github.com/repos/apache/beam/assignees{/user}","branches_url":"https://api.github.com/repos/apache/beam/branches{/branch}","tags_url":"https://api.github.com/repos/apache/beam/tags","blobs_url":"https://api.github.com/repos/apache/beam/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/beam/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/beam/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/beam/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/beam/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/beam/languages","stargazers_url":"https://api.github.com/repos/apache/beam/stargazers","contributors_url":"https://api.github.com/repos/apache/beam/contributors","subscribers_url":"https://api.github.com/repos/apache/beam/subscribers","subscription_url":"https://api.github.com/repos/apache/beam/subscription","commits_url":"https://api.github.com/repos/apache/beam/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/beam/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/beam/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/beam/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/beam/contents/{+path}","compare_url":"https://api.github.com/repos/apache/beam/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/beam/merges","archive_url":"https://api.github.com/repos/apache/beam/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/beam/downloads","issues_url":"https://api.github.com/repos/apache/beam/issues{/number}","pulls_url":"https://api.github.com/repos/apache/beam/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/beam/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/beam/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/beam/labels{/name}","releases_url":"https://api.github.com/repos/apache/beam/releases{/id}","deployments_url":"https://api.github.com/repos/apache/beam/deployments","created_at":"2016-02-02T08:00:06Z","updated_at":"2017-12-29T13:03:40Z","pushed_at":"2017-12-29T17:19:56Z","git_url":"git://github.com/apache/beam.git","ssh_url":"git@github.com:apache/beam.git","clone_url":"https://github.com/apache/beam.git","svn_url":"https://github.com/apache/beam","homepage":"","size":48695,"stargazers_count":1587,"watchers_count":1587,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":947,"mirror_url":null,"archived":false,"open_issues_count":110,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":947,"open_issues":110,"watchers":1587,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/beam/pulls/4248"},"html":{"href":"https://github.com/apache/beam/pull/4248"},"issue":{"href":"https://api.github.com/repos/apache/beam/issues/4248"},"comments":{"href":"https://api.github.com/repos/apache/beam/issues/4248/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/beam/pulls/4248/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/beam/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/beam/pulls/4248/commits"},"statuses":{"href":"https://api.github.com/repos/apache/beam/statuses/4255543cdc7cfcadd29633f321599d2f591021d8"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"pabloem"}}