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

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

                Author: ASF GitHub Bot
            Created on: 03/Jul/19 14:04
            Start Date: 03/Jul/19 14:04
    Worklog Time Spent: 10m 
      Work Description: lgajowy commented on pull request #8847: [BEAM-7550] 
Missing pipeline parameters in ParDo Load Test
URL: https://github.com/apache/beam/pull/8847#discussion_r299972757
 
 

 ##########
 File path: sdks/python/apache_beam/testing/load_tests/pardo_test.py
 ##########
 @@ -132,22 +136,37 @@
 @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()
+    if self.metrics_namespace is not None:
+      self.apply_filter([self.metrics_namespace])
+    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 _get_option_or_default(self, opt_name, default=0):
+    option = self.pipeline.get_option(opt_name)
+    try:
+      return int(option)
+    except TypeError:
+      return default
+    except ValueError as exc:
+      self.fail(str(exc))
 
   def testParDo(self):
-    class _GetElement(beam.DoFn):
-      from apache_beam.testing.load_tests.load_test_metrics_utils import 
count_bytes
-
-      @count_bytes
-      def process(self, element, namespace, is_returning):
-        if is_returning:
-          yield element
-
-    if not self.iterations:
-      num_runs = 1
-    else:
-      num_runs = int(self.iterations)
+    class CounterOperation(beam.DoFn):
 
 Review comment:
   Overall algorithm looks good to me
 
----------------------------------------------------------------
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: 271650)
    Time Spent: 3.5h  (was: 3h 20m)

> 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: 3.5h
>  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