[HUDI-1587] Add latency and freshness support (#2541)
Save min and max of event time in each commit and compute the latency and freshness metrics.
This commit is contained in:
@@ -19,6 +19,8 @@
|
||||
package org.apache.hudi.metrics;
|
||||
|
||||
import org.apache.hudi.common.model.HoodieCommitMetadata;
|
||||
import org.apache.hudi.common.util.Option;
|
||||
import org.apache.hudi.common.util.collection.Pair;
|
||||
import org.apache.hudi.config.HoodieWriteConfig;
|
||||
|
||||
import com.codahale.metrics.Timer;
|
||||
@@ -123,6 +125,7 @@ public class TestHoodieMetrics {
|
||||
when(metadata.getTotalCompactedRecordsUpdated()).thenReturn(randomValue + 11);
|
||||
when(metadata.getTotalLogFilesCompacted()).thenReturn(randomValue + 12);
|
||||
when(metadata.getTotalLogFilesSize()).thenReturn(randomValue + 13);
|
||||
when(metadata.getMinAndMaxEventTime()).thenReturn(Pair.of(Option.empty(), Option.empty()));
|
||||
metrics.updateCommitMetrics(randomValue + 14, commitTimer.stop(), metadata, action);
|
||||
|
||||
String metricname = metrics.getMetricsName(action, "duration");
|
||||
|
||||
Reference in New Issue
Block a user