asafm commented on code in PR #17041:
URL: https://github.com/apache/pulsar/pull/17041#discussion_r959406647
##########
pulsar-metadata/src/main/java/org/apache/pulsar/metadata/impl/AbstractMetadataStore.java:
##########
@@ -235,10 +239,20 @@ public <T> MetadataCache<T>
getMetadataCache(MetadataSerde<T> serde) {
@Override
public CompletableFuture<Optional<GetResult>> get(String path) {
+ long start = System.currentTimeMillis();
if (!isValidPath(path)) {
- return FutureUtil.failedFuture(new
MetadataStoreException.InvalidPathException(path));
+ stats.recordGetOpsFailed();
+ return FutureUtil
+ .failedFuture(new
MetadataStoreException.InvalidPathException(path));
}
- return storeGet(path);
+ return storeGet(path)
+ .whenComplete((v, t) -> {
+ if (t != null) {
+ stats.recordGetOpsFailed();
+ } else {
+ stats.recordGetOpsLatency(System.currentTimeMillis() -
start);
Review Comment:
I introduced a new comment iterating "2. You want latency also for failed
ops - sometimes they are the root cause - seeing spike in latency will explain
problems."
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]