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

ASF GitHub Bot logged work on GOBBLIN-1806:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 12/Apr/23 01:03
            Start Date: 12/Apr/23 01:03
    Worklog Time Spent: 10m 
      Work Description: Will-Lo commented on code in PR #3667:
URL: https://github.com/apache/gobblin/pull/3667#discussion_r1163461852


##########
gobblin-runtime/src/main/java/org/apache/gobblin/runtime/DatasetTaskSummary.java:
##########
@@ -17,30 +17,26 @@
 
 package org.apache.gobblin.runtime;
 
+import lombok.Data;
+
+import org.apache.gobblin.metrics.DatasetMetric;
+
+
 /**
  * A class returned by {@link org.apache.gobblin.runtime.SafeDatasetCommit} to 
provide metrics for the dataset
  * that can be reported as a single event in the commit phase.
  */
+@Data
 public class DatasetTaskSummary {
   private final String datasetUrn;
   private final long recordsWritten;
   private final long bytesWritten;
+  private final boolean datasetCommitSucceeded;
 
-  public DatasetTaskSummary(String datasetUrn, long recordsWritten, long 
bytesWritten) {
-    this.datasetUrn = datasetUrn;
-    this.recordsWritten = recordsWritten;
-    this.bytesWritten = bytesWritten;
-  }
-
-  public String getDatasetUrn() {
-    return datasetUrn;
-  }
-
-  public long getRecordsWritten() {
-    return recordsWritten;
-  }
-
-  public long getBytesWritten() {
-    return bytesWritten;
+  /**
+   * Convert a {@link DatasetTaskSummary} to a {@link DatasetMetric}.
+   */
+  public static DatasetMetric toDatasetMetric(DatasetTaskSummary 
datasetTaskSummary) {

Review Comment:
   if it's an instance method the syntax inside map would be different since it 
wouldn't be static anymore right? It should look like `.map(summary -> 
summary.toDatasetMetric())`





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

    Worklog Id:     (was: 856295)
    Time Spent: 2h 20m  (was: 2h 10m)

> Create a GTE for recording bytes/records written for each dataset in a 
> Gobblin job
> ----------------------------------------------------------------------------------
>
>                 Key: GOBBLIN-1806
>                 URL: https://issues.apache.org/jira/browse/GOBBLIN-1806
>             Project: Apache Gobblin
>          Issue Type: Improvement
>          Components: gobblin-core
>            Reporter: William Lo
>            Assignee: Abhishek Tiwari
>            Priority: Major
>          Time Spent: 2h 20m
>  Remaining Estimate: 0h
>
> Gobblin collects a lot of writer metrics on number of bytes and records 
> written to the sinks, but does not emit these metrics as part of a 
> GobblinTrackingEvent.
> We want to emit these in a GobblinTrackingEvent so that it can be ingested by 
> montioring systems and GaaS.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to