code: public synchronized void updateRecordMetrics(long recordsWritten, int branchIndex) {
      TaskMetrics metrics = TaskMetrics.get(this);
      // chopping branch index from metric name
      // String forkBranchId = ForkOperatorUtils.getForkId(this.taskId, branchIndex);
      String forkBranchId = TaskMetrics.taskInstanceRemoved(this.taskId);
  
      Counter taskRecordCounter = metrics.getCounter(MetricGroup.TASK.name(), forkBranchId, RECORDS);
      long inc = recordsWritten - taskRecordCounter.getCount();
      taskRecordCounter.inc(inc);
      metrics.getMeter(MetricGroup.TASK.name(), forkBranchId, RECORDS_PER_SECOND).mark(inc);
      metrics.getCounter(MetricGroup.JOB.name(), this.jobId, RECORDS).inc(inc);
      metrics.getMeter(MetricGroup.JOB.name(), this.jobId, RECORDS_PER_SECOND).mark(inc);
    }
docs: Update record-level metrics.
  
  @param recordsWritten number of records written by the writer
  @param branchIndex fork branch index
  
  @deprecated see {@link org.apache.gobblin.instrumented.writer.InstrumentedDataWriterBase}.