You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2022/06/04 16:33:33 UTC

[GitHub] [beam] damccorm opened a new issue, #20319: Add byte counters to SpannerIO.write

damccorm opened a new issue, #20319:
URL: https://github.com/apache/beam/issues/20319

   Currently SpannerIO has counters that count the number of mutationgroups written and the number successful writes to spanner.
   
   A common customer complaint regarding Spanner import is the lack of job progress information and a byte counter which shows the successful bytes written to spanner would help alleviate some customer pain.
   
    
   
   cc [~nielm]
   
    
   
   Imported from Jira [BEAM-9910](https://issues.apache.org/jira/browse/BEAM-9910). Original Jira may contain additional context.
   Reported by: alxavier.


-- 
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.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Add byte counters to SpannerIO.write [beam]

Posted by "jonathansudhakar1 (via GitHub) via github" <gi...@beam.apache.org>.
jonathansudhakar1 commented on issue #20319:
URL: https://github.com/apache/beam/issues/20319#issuecomment-7313737466

   @stankiewicz, this still applies on current master. `WriteToSpannerFn` counts batches and mutation groups (received, succeeded, failed), plus latency, timeouts and retries ([counters](https://github.com/apache/beam/blob/91c391fb67d342c20dbe4fa167e8fd5a60ecb743/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/spanner/SpannerIO.java#L2915-L2938)). It reports nothing about bytes, so a running job's metrics don't show how much data has been written.
   
   Proposed change (small, Java only), if it's still wanted:
   
   - **One new counter**, `spanner_write_bytes`, in the same `WriteGrouped` namespace as the others (the name is open). It's incremented by `MutationSizeEstimator.sizeOf` for each mutation group, but only after that group commits: the whole batch on the batch path, or each group that succeeds on the per-group retry path under `REPORT_FAILURES` ([processElement](https://github.com/apache/beam/blob/91c391fb67d342c20dbe4fa167e8fd5a60ecb743/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/spanner/SpannerIO.java#L2997-L3041)). Failed groups aren't counted.
   - **What it measures:** the same mutation-size estimate that `withBatchSizeBytes` uses, not bytes on the wire. The comment on the counter would say so.
   - **Cost:** one more `sizeOf` pass per group. The batching steps already compute it ([filter](https://github.com/apache/beam/blob/91c391fb67d342c20dbe4fa167e8fd5a60ecb743/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/spanner/SpannerIO.java#L2878), [gather](https://github.com/apache/beam/blob/91c391fb67d342c20dbe4fa167e8fd5a60ecb743/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/spanner/SpannerIO.java#L2742)). Passing the size along from there would change the batch element type, so I'd rather recompute it.
   - **Tests:** new `SpannerIOWriteTest` cases with the existing fakes. They'd check the counter for the batch path, for the `REPORT_FAILURES` retry path (only the groups that succeed are counted), and for `FAIL_FAST` (nothing is counted for a failed batch).
   
   Is a byte counter still useful here? If so, is a plain counter fine, or would you rather have something else, such as a distribution of bytes per batch?
   


-- 
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.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org