[ 
https://issues.apache.org/jira/browse/BEAM-7550?focusedWorklogId=266507&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-266507
 ]

ASF GitHub Bot logged work on BEAM-7550:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 25/Jun/19 09:58
            Start Date: 25/Jun/19 09:58
    Worklog Time Spent: 10m 
      Work Description: kkucharc commented on pull request #8847: [BEAM-7550] 
Missing pipeline parameters in ParDo Load Test
URL: https://github.com/apache/beam/pull/8847#discussion_r296767038
 
 

 ##########
 File path: sdks/python/apache_beam/testing/load_tests/pardo_test.py
 ##########
 @@ -132,22 +137,38 @@
 @unittest.skipIf(not load_test_enabled, 'Enabled only for phrase triggering.')
 class ParDoTest(LoadTest):
   def setUp(self):
-    self.output = self.pipeline.get_option('output')
-    self.iterations = self.pipeline.get_option('number_of_counter_operations')
+    super(ParDoTest, self).setUp()
+    self._apply_filter()
+    self.iterations = self._get_option_or_default('iterations')
+    self.nb_of_counter = self._get_option_or_default('number_of_counters')
+    self.nb_of_operations = self._get_option_or_default(
+        'number_of_counter_operations')
+
+  def _apply_filter(self):
+    """Prevents metrics from namespace other than specified in pipeline
+    options from being published."""
+    if self.metrics_monitor is not None:
+      self.metrics_monitor.filters = MetricsFilter().with_namespace(
+          self.metrics_namespace)
+
+  def _get_option_or_default(self, opt_name, default=1):
+    option = self.pipeline.get_option(opt_name)
+    return int(option) if option is not None else default
 
 Review comment:
   It might be useful to have this in `load_test_metrics_utils`, WDYT? There 
may be also exception thrown in casting to `int`.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 266507)
    Time Spent: 1h  (was: 50m)

> Implement missing pipeline parameters in ParDo Load Test
> --------------------------------------------------------
>
>                 Key: BEAM-7550
>                 URL: https://issues.apache.org/jira/browse/BEAM-7550
>             Project: Beam
>          Issue Type: Sub-task
>          Components: testing
>            Reporter: Kamil Wasilewski
>            Assignee: Kamil Wasilewski
>            Priority: Major
>          Time Spent: 1h
>  Remaining Estimate: 0h
>
> Without some pipeline parameters in ParDo Load Test in Python, it is 
> impossible to create all required test cases (see proposal: 
> [https://s.apache.org/load-test-basic-operations]).



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to