Copilot commented on code in PR #701:
URL: https://github.com/apache/iceberg-cpp/pull/701#discussion_r3689440316


##########
src/iceberg/update/snapshot_update.cc:
##########
@@ -194,7 +197,36 @@ 
SnapshotUpdate::SnapshotUpdate(std::shared_ptr<TransactionContext> ctx)
           
base().properties.Get(TableProperties::kSnapshotIdInheritanceEnabled)),
       commit_uuid_(Uuid::GenerateV7().ToString()),
       target_manifest_size_bytes_(
-          base().properties.Get(TableProperties::kManifestTargetSizeBytes)) {}
+          base().properties.Get(TableProperties::kManifestTargetSizeBytes)),
+      commit_metrics_(CommitMetrics::Make(*MetricsContext::Default())),
+      reporter_(ctx_->table->reporter()) {}
+
+Status SnapshotUpdate::Commit() {
+  commit_metrics_->attempts->Increment();
+  auto commit_timer = commit_metrics_->total_duration->Start();
+  return PendingUpdate::Commit();
+}

Review Comment:
   `commit_timer` is intentionally only used for RAII timing, but as written it 
is an unused local variable and can trigger `-Wunused-variable` warnings (often 
treated as errors in CI). Mark it `[[maybe_unused]]` (or otherwise silence the 
warning) while keeping the guard alive for the duration of `Commit()`.



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