Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Fixing the summary serialization issue for cache RCAs (#348)
Browse files Browse the repository at this point in the history
* Fixing the summary serialization issue for cache RCAs
  • Loading branch information
khushbr authored Aug 6, 2020
1 parent acfe086 commit 7be6969
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,21 +112,19 @@ public ResourceFlowUnit<HotNodeSummary> operate() {
cacheEvictionCollector.collect(currTimestamp);
if (counter >= rcaPeriod) {
ResourceContext context;
HotNodeSummary nodeSummary;

InstanceDetails instanceDetails = getInstanceDetails();
HotNodeSummary nodeSummary = new HotNodeSummary(instanceDetails.getInstanceId(), instanceDetails.getInstanceIp());

double fieldDataCacheMaxSizeInBytes = getCacheMaxSize(
getAppContext(), new NodeKey(instanceDetails), ResourceUtil.FIELD_DATA_CACHE_MAX_SIZE);
Boolean exceedsSizeThreshold = isSizeThresholdExceeded(
fieldDataCacheSizeGroupByOperation, fieldDataCacheMaxSizeInBytes, cacheSizeThreshold);
if (cacheEvictionCollector.isUnhealthy(currTimestamp) && exceedsSizeThreshold) {
context = new ResourceContext(Resources.State.UNHEALTHY);
nodeSummary = new HotNodeSummary(instanceDetails.getInstanceId(), instanceDetails.getInstanceIp());
nodeSummary.appendNestedSummary(cacheEvictionCollector.generateSummary(currTimestamp));
}
else {
context = new ResourceContext(Resources.State.HEALTHY);
nodeSummary = null;
}

counter = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ public ResourceFlowUnit operate() {
cacheHitCollector.collect(currTimestamp);
if (counter >= rcaPeriod) {
ResourceContext context;
HotNodeSummary nodeSummary;

InstanceDetails instanceDetails = getInstanceDetails();
HotNodeSummary nodeSummary = new HotNodeSummary(instanceDetails.getInstanceId(), instanceDetails.getInstanceIp());

double shardRequestCacheMaxSizeInBytes = getCacheMaxSize(
getAppContext(), new NodeKey(instanceDetails), ResourceUtil.SHARD_REQUEST_CACHE_MAX_SIZE);
Boolean exceedsSizeThreshold = isSizeThresholdExceeded(
Expand All @@ -138,11 +138,9 @@ public ResourceFlowUnit operate() {
&& cacheHitCollector.isUnhealthy(currTimestamp)
&& exceedsSizeThreshold) {
context = new ResourceContext(Resources.State.UNHEALTHY);
nodeSummary = new HotNodeSummary(instanceDetails.getInstanceId(), instanceDetails.getInstanceIp());
nodeSummary.appendNestedSummary(cacheEvictionCollector.generateSummary(currTimestamp));
} else {
context = new ResourceContext(Resources.State.HEALTHY);
nodeSummary = null;
}

counter = 0;
Expand Down

0 comments on commit 7be6969

Please sign in to comment.