Skip to content

Commit

Permalink
Add metrics for dataAccess.load
Browse files Browse the repository at this point in the history
  • Loading branch information
aarshi0301 committed Dec 21, 2023
1 parent 4b42b74 commit 91e7b6e
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
import org.apache.atlas.repository.store.graph.v2.AtlasEntityStream;
import org.apache.atlas.DeleteType;
import org.apache.atlas.utils.AtlasPerfTracer;
import org.apache.atlas.utils.AtlasPerfMetrics;
import org.apache.atlas.utils.AtlasPerfTracer;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
Expand Down Expand Up @@ -143,6 +145,7 @@ public <T extends AtlasBaseModelObject> T load(T obj) throws AtlasBaseException
public <T extends AtlasBaseModelObject> T load(T obj, boolean loadDeleted) throws AtlasBaseException {
Objects.requireNonNull(obj, "Can't load a null object");

AtlasPerfMetrics.MetricRecorder metric = RequestContext.get().startMetricRecord("DataAccess.load()");
AtlasPerfTracer perf = null;

try {
Expand Down Expand Up @@ -182,9 +185,9 @@ public <T extends AtlasBaseModelObject> T load(T obj, boolean loadDeleted) throw
return dto.from(entityWithExtInfo);

} finally {
RequestContext.get().endMetricRecord(metric);
AtlasPerfTracer.log(perf);
}

}

public <T extends AtlasBaseModelObject> T load(String guid, Class<? extends AtlasBaseModelObject> clazz) throws AtlasBaseException {
Expand Down

0 comments on commit 91e7b6e

Please sign in to comment.