kfaraz commented on code in PR #16616:
URL: https://github.com/apache/druid/pull/16616#discussion_r1643901002


##########
extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/output/S3UploadManager.java:
##########
@@ -87,25 +102,36 @@ public Future<UploadPartResult> queueChunkForUpload(
       S3OutputConfig config
   )
   {
-    return uploadExecutor.submit(() -> RetryUtils.retry(
-        () -> {
-          log.debug("Uploading chunk[%d] for uploadId[%s].", chunkNumber, 
uploadId);
-          UploadPartResult uploadPartResult = uploadPartIfPossible(
-              s3Client,
-              uploadId,
-              config.getBucket(),
-              key,
-              chunkNumber,
-              chunkFile
-          );
-          if (!chunkFile.delete()) {
-            log.warn("Failed to delete chunk [%s]", 
chunkFile.getAbsolutePath());
-          }
-          return uploadPartResult;
-        },
-        S3Utils.S3RETRY,
-        config.getMaxRetry()
-    ));
+    final ServiceMetricEvent.Builder builder = new 
ServiceMetricEvent.Builder();
+    final Stopwatch taskQueuedStopwatch = Stopwatch.createStarted();
+    queueSize.incrementAndGet();
+    return uploadExecutor.submit(() -> {
+      emitter.emit(builder.setMetric(TASK_QUEUED_DURATION_METRIC, 
taskQueuedStopwatch.millisElapsed()));
+      emitter.emit(builder.setMetric(NUM_TASKS_QUEUED_METRIC, 
queueSize.decrementAndGet()));
+      final Stopwatch taskDurationStopwatch = Stopwatch.createStarted();

Review Comment:
   Tip: you may `reset()` the same stopwatch, `taskQueuedStopwatch`, and reuse 
it for the task duration metric.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to