Repository: incubator-beam Updated Branches: refs/heads/python-sdk ba624e98f -> 240f8f673
Add profile_memory flag Runners with memory profiling support, would use this flag to profile the workflow for heap usage. Renamed the profile flag to profile_cpu flag to make the distinction clear. Project: http://git-wip-us.apache.org/repos/asf/incubator-beam/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-beam/commit/83563bd0 Tree: http://git-wip-us.apache.org/repos/asf/incubator-beam/tree/83563bd0 Diff: http://git-wip-us.apache.org/repos/asf/incubator-beam/diff/83563bd0 Branch: refs/heads/python-sdk Commit: 83563bd00bd2293466cedf0ace6c9b5d1f7de3ff Parents: ba624e9 Author: Ahmet Altay <al...@google.com> Authored: Mon Oct 10 14:12:51 2016 -0700 Committer: Robert Bradshaw <rober...@google.com> Committed: Tue Oct 11 10:50:41 2016 -0700 ---------------------------------------------------------------------- sdks/python/apache_beam/utils/options.py | 7 +++++-- sdks/python/apache_beam/utils/pipeline_options_test.py | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/83563bd0/sdks/python/apache_beam/utils/options.py ---------------------------------------------------------------------- diff --git a/sdks/python/apache_beam/utils/options.py b/sdks/python/apache_beam/utils/options.py index a964036..a3cea1e 100644 --- a/sdks/python/apache_beam/utils/options.py +++ b/sdks/python/apache_beam/utils/options.py @@ -370,9 +370,12 @@ class ProfilingOptions(PipelineOptions): @classmethod def _add_argparse_args(cls, parser): - parser.add_argument('--profile', + parser.add_argument('--profile_cpu', action='store_true', - help='Enable work item profiling') + help='Enable work item CPU profiling.') + parser.add_argument('--profile_memory', + action='store_true', + help='Enable work item heap profiling.') parser.add_argument('--profile_location', default=None, help='GCS path for saving profiler data.') http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/83563bd0/sdks/python/apache_beam/utils/pipeline_options_test.py ---------------------------------------------------------------------- diff --git a/sdks/python/apache_beam/utils/pipeline_options_test.py b/sdks/python/apache_beam/utils/pipeline_options_test.py index 5213275..249aa04 100644 --- a/sdks/python/apache_beam/utils/pipeline_options_test.py +++ b/sdks/python/apache_beam/utils/pipeline_options_test.py @@ -30,9 +30,9 @@ class PipelineOptionsTest(unittest.TestCase): 'expected': {'num_workers': 5, 'mock_flag': False, 'mock_option': None}}, { 'flags': [ - '--profile', '--profile_location', 'gs://bucket/', 'ignored'], + '--profile_cpu', '--profile_location', 'gs://bucket/', 'ignored'], 'expected': { - 'profile': True, 'profile_location': 'gs://bucket/', + 'profile_cpu': True, 'profile_location': 'gs://bucket/', 'mock_flag': False, 'mock_option': None} }, {'flags': ['--num_workers', '5', '--mock_flag'],