[HUDI-2055] Added deltastreamer metric for time of lastSync (#3129)
This commit is contained in:
committed by
GitHub
parent
1d6978cde4
commit
05d6e18190
@@ -290,6 +290,8 @@ public class DeltaSync implements Serializable {
|
|||||||
srcRecordsWithCkpt.getRight().getLeft(), metrics, overallTimerContext);
|
srcRecordsWithCkpt.getRight().getLeft(), metrics, overallTimerContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
metrics.updateDeltaStreamerSyncMetrics(System.currentTimeMillis());
|
||||||
|
|
||||||
// Clear persistent RDDs
|
// Clear persistent RDDs
|
||||||
jssc.getPersistentRDDs().values().forEach(JavaRDD::unpersist);
|
jssc.getPersistentRDDs().values().forEach(JavaRDD::unpersist);
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
@@ -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) {
|
public long getDurationInMs(long ctxDuration) {
|
||||||
return ctxDuration / 1000000;
|
return ctxDuration / 1000000;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user