From f04603bdd15099e8b5291690c6859d5bec04a3f8 Mon Sep 17 00:00:00 2001 From: suraj5077 Date: Wed, 4 Dec 2024 17:54:41 +0530 Subject: [PATCH] Added perf loggers for vertex + edge filters --- .../atlas/discovery/EntityLineageService.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/repository/src/main/java/org/apache/atlas/discovery/EntityLineageService.java b/repository/src/main/java/org/apache/atlas/discovery/EntityLineageService.java index 1919e6df99..a8841eb1aa 100644 --- a/repository/src/main/java/org/apache/atlas/discovery/EntityLineageService.java +++ b/repository/src/main/java/org/apache/atlas/discovery/EntityLineageService.java @@ -1328,11 +1328,21 @@ private boolean vertexMatchesEvaluation(AtlasVertex currentVertex, AtlasLineageC } private boolean vertexMatchesEvaluation(AtlasVertex currentVertex, AtlasLineageOnDemandContext atlasLineageOnDemandContext) { - return atlasLineageOnDemandContext.evaluate(currentVertex); + AtlasPerfMetrics.MetricRecorder metric = RequestContext.get().startMetricRecord("vertexMatchesEvaluation"); + try { + return atlasLineageOnDemandContext.evaluate(currentVertex); + } finally { + RequestContext.get().endMetricRecord(metric); + } } private boolean edgeMatchesEvaluation(AtlasEdge currentEdge, AtlasLineageOnDemandContext atlasLineageOnDemandContext) { - return atlasLineageOnDemandContext.evaluate(currentEdge); + AtlasPerfMetrics.MetricRecorder metric = RequestContext.get().startMetricRecord("edgeMatchesEvaluation"); + try { + return atlasLineageOnDemandContext.evaluate(currentEdge); + } finally { + RequestContext.get().endMetricRecord(metric); + } } private boolean shouldProcessEdge(AtlasLineageContext lineageContext, AtlasEdge edge) {