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

Create a base class RCA ResourceResourceRca as a generic resource type RCA. Add HighCpuRca to collect total cpu usage #125

Merged
merged 3 commits into from
Mar 31, 2020

Conversation

rguo-aws
Copy link
Contributor

Issue #, if available:

Description of changes:
The GenericResourceRca is a base type RCA class which collect aggregated metric from a certain resource type and calculated its averaged sum by using a sliding window.

The HighCpuRca derives from the TotalResourceRca to calculate the cpu usage of its node and list the top k consumers.

Add a unit test for this rca class

Tests:
tested on dev stack

Code coverage percentage for this patch:
82%

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@rguo-aws rguo-aws requested review from ditac, yojs and ktkrg March 10, 2020 01:18
private final int rcaPeriod;
private int counter;
private final ResourceType resourceType;
private double threshold;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make this final so that its threadsafe?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have changed those variables to volatile to make them thread safe

@rguo-aws rguo-aws requested a review from ditac March 23, 2020 19:51
@ditac ditac merged commit bb01028 into master Mar 31, 2020
@rguo-aws rguo-aws deleted the rguo-generic-resource branch March 31, 2020 23:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants