Skip to content

Commit

Permalink
HDDS-9271. SortDatanodes metric in OM getKeyInfo (#5280)
Browse files Browse the repository at this point in the history
  • Loading branch information
duongkame authored Sep 12, 2023
1 parent af72296 commit 8ee276c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1955,7 +1955,8 @@ public OmKeyInfo getKeyInfo(OmKeyArgs args, String clientAddress)
args.isForceUpdateContainerCacheFromSCM()));

if (args.getSortDatanodes()) {
sortDatanodes(clientAddress, value);
captureLatencyNs(metrics.getGetKeyInfoSortDatanodesLatencyNs(),
() -> sortDatanodes(clientAddress, value));
}
}
return value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ public static void unregister() {
@Metric(about = "ACLs check in getKeyInfo")
private MutableRate getKeyInfoAclCheckLatencyNs;

@Metric(about = "Sort datanodes latency in getKeyInfo")
private MutableRate getKeyInfoSortDatanodesLatencyNs;

@Metric(about = "resolveBucketLink latency in getKeyInfo")
private MutableRate getKeyInfoResolveBucketLatencyNs;

Expand Down Expand Up @@ -142,6 +145,10 @@ public MutableRate getGetKeyInfoResolveBucketLatencyNs() {
return getKeyInfoResolveBucketLatencyNs;
}

public MutableRate getGetKeyInfoSortDatanodesLatencyNs() {
return getKeyInfoSortDatanodesLatencyNs;
}

public void setForceContainerCacheRefresh(boolean value) {
forceContainerCacheRefresh.add(value ? 1L : 0L);
}
Expand Down

0 comments on commit 8ee276c

Please sign in to comment.