{"action":"created","comment":{"url":"https://api.github.com/repos/apache/beam/pulls/comments/197629461","pull_request_review_id":131412888,"id":197629461,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NzYyOTQ2MQ==","diff_hunk":"@@ -0,0 +1,85 @@\n+#\n+# Licensed to the Apache Software Foundation (ASF) under one or more\n+# contributor license agreements.  See the NOTICE file distributed with\n+# this work for additional information regarding copyright ownership.\n+# The ASF licenses this file to You under the Apache License, Version 2.0\n+# (the \"License\"); you may not use this file except in compliance with\n+# the License.  You may obtain a copy of the License at\n+#\n+#    http://www.apache.org/licenses/LICENSE-2.0\n+#\n+# Unless required by applicable law or agreed to in writing, software\n+# distributed under the License is distributed on an \"AS IS\" BASIS,\n+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+# See the License for the specific language governing permissions and\n+# limitations under the License.\n+#\n+\n+\"\"\"Utilities for the Nexmark suite.\n+\n+The Nexmark suite is a series of queries (streaming pipelines) performed\n+on a simulation of auction events. This util includes a Command class used\n+to terminate the streaming jobs launched in nexmark_launcher.py.\n+\n+Usage:\n+To run a process for a certain duration, define in the code:\n+  command = Command(process_to_terminate, args)\n+  command.run(timeout=duration)\n+\n+To test, run in a shell:\n+  $ python nexmark_util.py\n+\"\"\"\n+from __future__ import print_function\n+\n+import logging\n+import threading\n+import time\n+from multiprocessing import Process\n+\n+\n+logging.basicConfig(level=logging.DEBUG,\n+                    format='(%(threadName)-10s) %(message)s')\n+\n+\n+class Command(object):\n+  def __init__(self, cmd, args, rc_cb=None):\n+    self.cmd = cmd\n+    self.args = args\n+    self.process = None\n+    self.rc_cb = rc_cb\n+\n+  def run(self, timeout):\n+    def thread_target():\n+      logging.debug('Starting thread for %d seconds: %s',\n+                    timeout, self.cmd.__name__)\n+\n+      self.process = Process(target=self.cmd, args=self.args)\n+      self.process.start()\n+      self.process.join()\n+\n+      logging.info('%d seconds elapsed. Thread (%s) finished.',\n+                   timeout, self.cmd.__name__)\n+\n+    thread = threading.Thread(target=thread_target, name='Thread-timeout')","path":"sdks/python/apache_beam/testing/benchmarks/nexmark/nexmark_util.py","position":63,"original_position":63,"commit_id":"5c5197bbb77affbbcf8d4dd824a14994b9cc35a5","original_commit_id":"5c5197bbb77affbbcf8d4dd824a14994b9cc35a5","user":{"login":"mariapython","id":7925361,"node_id":"MDQ6VXNlcjc5MjUzNjE=","avatar_url":"https://avatars0.githubusercontent.com/u/7925361?v=4","gravatar_id":"","url":"https://api.github.com/users/mariapython","html_url":"https://github.com/mariapython","followers_url":"https://api.github.com/users/mariapython/followers","following_url":"https://api.github.com/users/mariapython/following{/other_user}","gists_url":"https://api.github.com/users/mariapython/gists{/gist_id}","starred_url":"https://api.github.com/users/mariapython/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mariapython/subscriptions","organizations_url":"https://api.github.com/users/mariapython/orgs","repos_url":"https://api.github.com/users/mariapython/repos","events_url":"https://api.github.com/users/mariapython/events{/privacy}","received_events_url":"https://api.github.com/users/mariapython/received_events","type":"User","site_admin":false},"body":"You are right that it helps simplify the util (no need to have multiprocessing), so I modified it.","created_at":"2018-06-24T06:14:22Z","updated_at":"2018-06-24T06:14:22Z","html_url":"https://github.com/apache/beam/pull/5738#discussion_r197629461","pull_request_url":"https://api.github.com/repos/apache/beam/pulls/5738","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/apache/beam/pulls/comments/197629461"},"html":{"href":"https://github.com/apache/beam/pull/5738#discussion_r197629461"},"pull_request":{"href":"https://api.github.com/repos/apache/beam/pulls/5738"}},"in_reply_to_id":197598347},"pull_request":{"url":"https://api.github.com/repos/apache/beam/pulls/5738","id":196778343,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk2Nzc4MzQz","html_url":"https://github.com/apache/beam/pull/5738","diff_url":"https://github.com/apache/beam/pull/5738.diff","patch_url":"https://github.com/apache/beam/pull/5738.patch","issue_url":"https://api.github.com/repos/apache/beam/issues/5738","number":5738,"state":"open","locked":false,"title":"[BEAM-2855] Add Python Nexmark suite","user":{"login":"mariapython","id":7925361,"node_id":"MDQ6VXNlcjc5MjUzNjE=","avatar_url":"https://avatars0.githubusercontent.com/u/7925361?v=4","gravatar_id":"","url":"https://api.github.com/users/mariapython","html_url":"https://github.com/mariapython","followers_url":"https://api.github.com/users/mariapython/followers","following_url":"https://api.github.com/users/mariapython/following{/other_user}","gists_url":"https://api.github.com/users/mariapython/gists{/gist_id}","starred_url":"https://api.github.com/users/mariapython/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mariapython/subscriptions","organizations_url":"https://api.github.com/users/mariapython/orgs","repos_url":"https://api.github.com/users/mariapython/repos","events_url":"https://api.github.com/users/mariapython/events{/privacy}","received_events_url":"https://api.github.com/users/mariapython/received_events","type":"User","site_admin":false},"body":" - [x] Add model.\r\n - [x] Add launcher.\r\n - [x] Add generator\r\n - [x] Add query0.\r\n","created_at":"2018-06-22T15:55:03Z","updated_at":"2018-06-24T06:14:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fe71cd66405d07bb2fc90f43af7b3fd9a2578b59","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/beam/pulls/5738/commits","review_comments_url":"https://api.github.com/repos/apache/beam/pulls/5738/comments","review_comment_url":"https://api.github.com/repos/apache/beam/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/beam/issues/5738/comments","statuses_url":"https://api.github.com/repos/apache/beam/statuses/5c5197bbb77affbbcf8d4dd824a14994b9cc35a5","head":{"label":"mariapython:nexmark_pr","ref":"nexmark_pr","sha":"5c5197bbb77affbbcf8d4dd824a14994b9cc35a5","user":{"login":"mariapython","id":7925361,"node_id":"MDQ6VXNlcjc5MjUzNjE=","avatar_url":"https://avatars0.githubusercontent.com/u/7925361?v=4","gravatar_id":"","url":"https://api.github.com/users/mariapython","html_url":"https://github.com/mariapython","followers_url":"https://api.github.com/users/mariapython/followers","following_url":"https://api.github.com/users/mariapython/following{/other_user}","gists_url":"https://api.github.com/users/mariapython/gists{/gist_id}","starred_url":"https://api.github.com/users/mariapython/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mariapython/subscriptions","organizations_url":"https://api.github.com/users/mariapython/orgs","repos_url":"https://api.github.com/users/mariapython/repos","events_url":"https://api.github.com/users/mariapython/events{/privacy}","received_events_url":"https://api.github.com/users/mariapython/received_events","type":"User","site_admin":false},"repo":{"id":66086060,"node_id":"MDEwOlJlcG9zaXRvcnk2NjA4NjA2MA==","name":"incubator-beam","full_name":"mariapython/incubator-beam","owner":{"login":"mariapython","id":7925361,"node_id":"MDQ6VXNlcjc5MjUzNjE=","avatar_url":"https://avatars0.githubusercontent.com/u/7925361?v=4","gravatar_id":"","url":"https://api.github.com/users/mariapython","html_url":"https://github.com/mariapython","followers_url":"https://api.github.com/users/mariapython/followers","following_url":"https://api.github.com/users/mariapython/following{/other_user}","gists_url":"https://api.github.com/users/mariapython/gists{/gist_id}","starred_url":"https://api.github.com/users/mariapython/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mariapython/subscriptions","organizations_url":"https://api.github.com/users/mariapython/orgs","repos_url":"https://api.github.com/users/mariapython/repos","events_url":"https://api.github.com/users/mariapython/events{/privacy}","received_events_url":"https://api.github.com/users/mariapython/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mariapython/incubator-beam","description":"Mirror of Apache Beam","fork":true,"url":"https://api.github.com/repos/mariapython/incubator-beam","forks_url":"https://api.github.com/repos/mariapython/incubator-beam/forks","keys_url":"https://api.github.com/repos/mariapython/incubator-beam/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mariapython/incubator-beam/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mariapython/incubator-beam/teams","hooks_url":"https://api.github.com/repos/mariapython/incubator-beam/hooks","issue_events_url":"https://api.github.com/repos/mariapython/incubator-beam/issues/events{/number}","events_url":"https://api.github.com/repos/mariapython/incubator-beam/events","assignees_url":"https://api.github.com/repos/mariapython/incubator-beam/assignees{/user}","branches_url":"https://api.github.com/repos/mariapython/incubator-beam/branches{/branch}","tags_url":"https://api.github.com/repos/mariapython/incubator-beam/tags","blobs_url":"https://api.github.com/repos/mariapython/incubator-beam/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mariapython/incubator-beam/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mariapython/incubator-beam/git/refs{/sha}","trees_url":"https://api.github.com/repos/mariapython/incubator-beam/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mariapython/incubator-beam/statuses/{sha}","languages_url":"https://api.github.com/repos/mariapython/incubator-beam/languages","stargazers_url":"https://api.github.com/repos/mariapython/incubator-beam/stargazers","contributors_url":"https://api.github.com/repos/mariapython/incubator-beam/contributors","subscribers_url":"https://api.github.com/repos/mariapython/incubator-beam/subscribers","subscription_url":"https://api.github.com/repos/mariapython/incubator-beam/subscription","commits_url":"https://api.github.com/repos/mariapython/incubator-beam/commits{/sha}","git_commits_url":"https://api.github.com/repos/mariapython/incubator-beam/git/commits{/sha}","comments_url":"https://api.github.com/repos/mariapython/incubator-beam/comments{/number}","issue_comment_url":"https://api.github.com/repos/mariapython/incubator-beam/issues/comments{/number}","contents_url":"https://api.github.com/repos/mariapython/incubator-beam/contents/{+path}","compare_url":"https://api.github.com/repos/mariapython/incubator-beam/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mariapython/incubator-beam/merges","archive_url":"https://api.github.com/repos/mariapython/incubator-beam/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mariapython/incubator-beam/downloads","issues_url":"https://api.github.com/repos/mariapython/incubator-beam/issues{/number}","pulls_url":"https://api.github.com/repos/mariapython/incubator-beam/pulls{/number}","milestones_url":"https://api.github.com/repos/mariapython/incubator-beam/milestones{/number}","notifications_url":"https://api.github.com/repos/mariapython/incubator-beam/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mariapython/incubator-beam/labels{/name}","releases_url":"https://api.github.com/repos/mariapython/incubator-beam/releases{/id}","deployments_url":"https://api.github.com/repos/mariapython/incubator-beam/deployments","created_at":"2016-08-19T13:55:45Z","updated_at":"2017-03-19T07:45:08Z","pushed_at":"2018-06-23T06:28:18Z","git_url":"git://github.com/mariapython/incubator-beam.git","ssh_url":"git@github.com:mariapython/incubator-beam.git","clone_url":"https://github.com/mariapython/incubator-beam.git","svn_url":"https://github.com/mariapython/incubator-beam","homepage":"","size":90691,"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":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"01e250737173c6df99be7fc62917614d436d6950","user":{"login":"apache","id":47359,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3MzU5","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,"node_id":"MDEwOlJlcG9zaXRvcnk1MDkwNDI0NQ==","name":"beam","full_name":"apache/beam","owner":{"login":"apache","id":47359,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3MzU5","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":"2018-06-23T17:30:22Z","pushed_at":"2018-06-24T04:45:42Z","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":96058,"stargazers_count":1930,"watchers_count":1930,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1203,"mirror_url":null,"archived":false,"open_issues_count":88,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":1203,"open_issues":88,"watchers":1930,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/beam/pulls/5738"},"html":{"href":"https://github.com/apache/beam/pull/5738"},"issue":{"href":"https://api.github.com/repos/apache/beam/issues/5738"},"comments":{"href":"https://api.github.com/repos/apache/beam/issues/5738/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/beam/pulls/5738/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/beam/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/beam/pulls/5738/commits"},"statuses":{"href":"https://api.github.com/repos/apache/beam/statuses/5c5197bbb77affbbcf8d4dd824a14994b9cc35a5"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"mariapython"}}