Commit ab38ec3a by Jason Song

record cache hit statistics

parent ba6c1699
......@@ -124,6 +124,7 @@ public class ConfigFileController implements ReleaseMessageListener{
String result = localCache.getIfPresent(cacheKey);
if (Strings.isNullOrEmpty(result)) {
Cat.logEvent("ConfigFile-Cache-Miss", cacheKey);
ApolloConfig apolloConfig =
configController
.queryConfig(appId, clusterName, namespace, dataCenter, "-1", clientIp,
......@@ -148,6 +149,8 @@ public class ConfigFileController implements ReleaseMessageListener{
cacheKey2WatchedKeys.putAll(cacheKey, watchedKeys);
logger.debug("added cache for key: {}", cacheKey);
} else {
Cat.logEvent("ConfigFile-Cache-Hit", cacheKey);
}
return new ResponseEntity<>(result, responseHeaders,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment