-
Notifications
You must be signed in to change notification settings - Fork 20
Integration test framework to test RCAs and decision Makers #301
Conversation
Codecov Report
@@ Coverage Diff @@
## master #301 +/- ##
============================================
+ Coverage 67.17% 67.76% +0.59%
- Complexity 2086 2135 +49
============================================
Files 301 301
Lines 13326 13403 +77
Branches 1104 1115 +11
============================================
+ Hits 8952 9083 +131
+ Misses 3970 3923 -47
+ Partials 404 397 -7 Continue to review full report at Codecov.
|
8ac14bf
to
d5f98c1
Compare
...ava/com/amazon/opendistro/elasticsearch/performanceanalyzer/rca/persistence/Persistable.java
Outdated
Show resolved
Hide resolved
@@ -245,14 +249,14 @@ private synchronized void rotateRegisterGarbageThenCreateNewDB(RotationType type | |||
} | |||
|
|||
/** recursively insert nested summary to sql tables */ | |||
private void writeSummary( | |||
private synchronized void writeSummary( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I am wrong. but since we've already added synchronized keyword in the parent function which calls this private function, do we still need to add another synchronized keyword here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No you are 100% right. Its not required. Its just that some of the private methods in the class were marked as synchronized so I made them all be so. Just making the public methods should suffice.
if (!de.getMessage().contains("no such table")) { | ||
// it is totally fine if we fail to read some certain tables. | ||
LOG.warn("Fail to read RCA : {}.", rca, de); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we print an error log if otherwise
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean make it an error log instead of warning ?
//check if RCA is valid | ||
if (!validParams(rcaList)) { | ||
// rcaList = SQLiteQueryUtils.getClusterLevelRca(); | ||
rcaList = persistable.getAllPersistedRcas(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will contain RCAs that are not cluster level RCAs. Do we also want to expose node level RCAs on local master node to user ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to. Eventually, We would want to expose the RCAs on the local node, if they are not elected master.
The only thing with RCAs are that they are nested so, we won't want one node to gather RCAs from all nodes but if the request hits a node, it should be able to get all local RCAs.
@@ -178,14 +185,6 @@ private void handleClusterRcaRequest(Map<String, String> params, HttpExchange ex | |||
HttpURLConnection.HTTP_BAD_REQUEST); | |||
return; | |||
} | |||
//check if we are querying from elected master |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we would want to
...a/com/amazon/opendistro/elasticsearch/performanceanalyzer/rca/integTests/framework/Host.java
Show resolved
Hide resolved
This PR introduces a framework that can be used to write tests concerning RCA graph and all the components that leverage it(RCAs, Deciders etc.). Currently it supports adding custom metrics, running tests against single node cluster, multi-node clusters with dedicated masters and the ones without dedicated masters. It provies a way to query the SQLite datastore file on a particular host or hit the rest endpoint on a particular node. Currently, the nodes of the clsuters work over http only.
…e scheduler initializations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is basically JUnit for RCAs. It's insane how cool this is. I just have a few minor nits, the logic in here is solid and it's pretty much ready to merge.
fixes: #337
Description of changes:
This PR introduces a framework that can be used to write tests concerning
RCA graph and all the components that leverage it(RCAs, Deciders etc.).
Currently it supports adding custom metrics, running tests against
single node cluster, multi-node clusters with dedicated masters and
the ones without dedicated masters. It provides a way to query the
SQLite data-store file on a particular host or hit the rest endpoint
on a particular node. Currently, the nodes of the clusters work over
http only. For more details, I would point you here
Tests:
There is a POC test to check the working of the framework.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.