1
0

[HUDI-2055] Added deltastreamer metric for time of lastSync (#3129)

This commit is contained in:
Sebastian Bernauer
2021-07-06 08:34:46 +02:00
committed by GitHub
parent 1d6978cde4
commit 05d6e18190
2 changed files with 8 additions and 0 deletions

View File

@@ -290,6 +290,8 @@ public class DeltaSync implements Serializable {
srcRecordsWithCkpt.getRight().getLeft(), metrics, overallTimerContext);
}
metrics.updateDeltaStreamerSyncMetrics(System.currentTimeMillis());
// Clear persistent RDDs
jssc.getPersistentRDDs().values().forEach(JavaRDD::unpersist);
return result;

View File

@@ -95,6 +95,12 @@ public class HoodieDeltaStreamerMetrics implements Serializable {
}
}
public void updateDeltaStreamerSyncMetrics(long syncEpochTimeInMs) {
if (config.isMetricsOn()) {
Metrics.registerGauge(getMetricsName("deltastreamer", "lastSync"), syncEpochTimeInMs);
}
}
public long getDurationInMs(long ctxDuration) {
return ctxDuration / 1000000;
}