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

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

                Author: ASF GitHub Bot
            Created on: 26/Nov/18 17:47
            Start Date: 26/Nov/18 17:47
    Worklog Time Spent: 10m 
      Work Description: swegner commented on a change in pull request #7087: 
[BEAM-6100] Collect metrics properly in Load tests
URL: https://github.com/apache/beam/pull/7087#discussion_r236342732
 
 

 ##########
 File path: 
sdks/java/testing/load-tests/src/main/java/org/apache/beam/sdk/loadtests/CoGroupByKeyLoadTest.java
 ##########
 @@ -92,22 +92,22 @@ void loadTest() throws IOException {
     Optional<SyntheticStep> syntheticStep = 
createStep(options.getStepOptions());
 
     PCollection<KV<byte[], byte[]>> input =
-        applyStepIfPresent(
-            pipeline.apply("Read input", 
SyntheticBoundedIO.readFrom(sourceOptions)),
-            "Synthetic step for input",
-            syntheticStep);
+        pipeline.apply("Read input", 
SyntheticBoundedIO.readFrom(sourceOptions));
+    input = input.apply("Collect start time metrics (input)", 
ParDo.of(runtimeMonitor));
 
 Review comment:
   This unfortunately won't capture the time spent in the upstream source. This 
seems like a current limitation of the model since sources can only exist at 
the pipeline roots. With SplittableDoFn it will be easier to inject things at 
the beginning of the pipeline.
   
   If its important to include all time including the source, another option 
would be to add hooks in `SyntheticBoundedIO` to execute counter collection 
code. i.e. something like:
   
   ```java
   SyntheticBoundedIO
     .readFrom(sourceOptions)
     .withBeforeRead(() -> timeDistribution.update(System.currentTimeMillis()));
   ```
   
   If it's not important to capture absolutely all timing, then it's fine to 
leave as-is; but perhaps leave a comment noting the limitation.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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: 169413)
    Time Spent: 1h 40m  (was: 1h 20m)

> Runtime and total bytes metrics are not collected properly
> ----------------------------------------------------------
>
>                 Key: BEAM-6100
>                 URL: https://issues.apache.org/jira/browse/BEAM-6100
>             Project: Beam
>          Issue Type: Sub-task
>          Components: testing
>            Reporter: Lukasz Gajowy
>            Assignee: Lukasz Gajowy
>            Priority: Major
>          Time Spent: 1h 40m
>  Remaining Estimate: 0h
>
> Currently, we collect time (distribution) and bytes (counter) metrics from 
> one ParDo (called MetricsMonitor) that is put in pipelines in one, 
> arbitrarily chosen place (usually "in the middle" of pipeline's graph. In 
> some cases, invalid time (or total bytes count) is registered. 
> Taking [this|https://github.com/apache/beam/pull/6987#discussion_r231976671] 
> discussion into account, ideally, we'd like to:
>  - collect runtime by recording time at the root and sink(s) of the pipeline
>  - collect total bytes in a separate ParDo that allows deciding what byte 
> amount do we actually want to collect (now it's coupled to the 
> time-collecting Monitor which is inconvenient).



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

Reply via email to