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

Implement Action Flip Flop Detection in the Publisher #287

Conversation

sidheart
Copy link
Contributor

Issue #: #286

Description of changes:
We don't want to rubber-band when applying Actions (e.g. applying a CPU
increase right after we apply a CPU decrease).

This commit implements logic which allows the Publisher to reject
Actions which flip flop.

Tests:

  • TimeExpiringSetTest - Verifies that the underlying TimedFlipFlopDetector collection works as expected
  • PublisherTest - Verifies that the publisher rejects flip flopping actions
  • TimedFlipFlopDetectorTest - Verifies that the FlipFlopDetector implementation works as expected

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

@sidheart sidheart added the enhancement Enhancements to existing codebase label Jul 17, 2020
@sidheart sidheart self-assigned this Jul 17, 2020
@codecov
Copy link

codecov bot commented Jul 17, 2020

Codecov Report

Merging #287 into master will increase coverage by 0.05%.
The diff coverage is 81.81%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #287      +/-   ##
============================================
+ Coverage     67.26%   67.31%   +0.05%     
- Complexity     1949     1974      +25     
============================================
  Files           286      288       +2     
  Lines         12712    12766      +54     
  Branches       1034     1040       +6     
============================================
+ Hits           8551     8594      +43     
- Misses         3798     3809      +11     
  Partials        363      363              
Impacted Files Coverage Δ Complexity Δ
...ceanalyzer/decisionmaker/actions/ImpactVector.java 81.25% <14.28%> (-18.75%) 10.00 <1.00> (+1.00) ⬇️
...rformanceanalyzer/collections/TimeExpiringSet.java 83.33% <83.33%> (ø) 6.00 <6.00> (?)
...r/decisionmaker/actions/TimedFlipFlopDetector.java 93.75% <93.75%> (ø) 15.00 <15.00> (?)
...anceanalyzer/decisionmaker/deciders/Publisher.java 64.28% <100.00%> (+2.74%) 10.00 <1.00> (+2.00)
...erformanceanalyzer/rca/scheduler/RCAScheduler.java 66.17% <0.00%> (-2.95%) 9.00% <0.00%> (ø%)
...csearch/performanceanalyzer/rca/RcaController.java 81.66% <0.00%> (+0.55%) 39.00% <0.00%> (+1.00%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 781ae08...f34ed6c. Read the comment docs.

@sidheart sidheart force-pushed the publisher-action-flip-flop branch 2 times, most recently from ae89583 to df5ad95 Compare July 21, 2020 17:39
Copy link
Contributor

@vigyasharma vigyasharma left a comment

Choose a reason for hiding this comment

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

Changes look good, few renaming related comments but good to merge.

@sidheart sidheart force-pushed the publisher-action-flip-flop branch from e9f53d1 to 290f6ae Compare July 23, 2020 21:56
* @return true if the impact for any given Dimension in curr is a flip flop Impact when compared to
* the impact for a given dimension in prev
*/
protected boolean isFlipFlopVector(ImpactVector prev, ImpactVector curr) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you think we will need the resource name for which the flip flop happened ?
So, for for prev = (HEAP: INCREASE, CPU: INCREASE), curr = (HEAP: DECREASE, CPU: INCREASE), we can return HEAP instead of Boolean value ?

What I want to understand is if we use(or might use in future) this information anywhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since it's trivial to add this information in the future by extracting the logic in this function, I think we can table this until the need arises

Sid Narayan added 6 commits July 27, 2020 13:50
We don't want to rubber-band when applying Actions (e.g. applying a CPU
increase right after we apply a CPU decrease).

This commit implements logic which allows the Publisher to reject
Actions which flip flop.
@sidheart sidheart force-pushed the publisher-action-flip-flop branch from 290f6ae to f34ed6c Compare July 27, 2020 20:51
Copy link
Contributor

@khushbr khushbr left a comment

Choose a reason for hiding this comment

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

LGTM!

@sidheart sidheart merged commit 99ba548 into opendistro-for-elasticsearch:master Jul 27, 2020
@sidheart sidheart deleted the publisher-action-flip-flop branch July 27, 2020 22:55
@sidheart sidheart linked an issue Jul 30, 2020 that may be closed by this pull request
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Enhancements to existing codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Action Flip Flop Detection to Decision Maker Framework
3 participants