Skip to content

Bug fixes and unit tests#177

Merged
kaituo merged 1 commit intoopensearch-project:mainfrom
kaituo:unused
Aug 19, 2021
Merged

Bug fixes and unit tests#177
kaituo merged 1 commit intoopensearch-project:mainfrom
kaituo:unused

Conversation

@kaituo
Copy link
Copy Markdown
Collaborator

@kaituo kaituo commented Aug 16, 2021

Description

First, this PR adds an empty string check in PriorityCache.
Second, in EntityColdStarter, this PR clears samples after using them for training.
Third, this PR removes unused fields and local variables in ModelManager and BulkUtil.
Fourth, this PR decreases the concurrent preview from 5 to 2, with a conservative purpose to reduce potential GC.
Fifth, this PR finishes unit tests owed due to my previous PRs. 99% code of the PR is about tests.

Testing done:

  1. Added unit tests.
  2. made sure the basic e2e workflow still works.

Check List

  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@kaituo kaituo requested review from ohltyler and ylwu-amzn August 16, 2021 17:33
@kaituo kaituo added the bug Something isn't working label Aug 16, 2021
First, this PR adds an empty string check in PriorityCache.
Second, in EntityColdStarter, this PR clears samples after using them for training.
Third, this PR removes unused fields and local variables in ModelManager and BulkUtil.
Fourth, this PR decreases the concurrent preview from 5 to 2, with a conservative purpose to reduce potential GC.
Fifth, this PR finishes unit tests owed due to my previous PRs. 99% code of the PR is about tests.

Testing done:
1. Added unit tests.
2. made sure the basic e2e workflow still works.
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

Merging #177 (1ddce7d) into main (878918e) will increase coverage by 2.46%.
The diff coverage is 75.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##               main     #177      +/-   ##
============================================
+ Coverage     67.66%   70.12%   +2.46%     
- Complexity     2885     2995     +110     
============================================
  Files           270      270              
  Lines         14104    14088      -16     
  Branches       1418     1414       -4     
============================================
+ Hits           9543     9879     +336     
+ Misses         3973     3590     -383     
- Partials        588      619      +31     
Flag Coverage Δ
plugin 70.12% <75.00%> (+2.46%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
.../java/org/opensearch/ad/caching/PriorityCache.java 68.05% <0.00%> (ø)
...opensearch/ad/indices/AnomalyDetectionIndices.java 70.00% <ø> (+19.68%) ⬆️
...c/main/java/org/opensearch/ad/ml/ModelManager.java 85.47% <ø> (+3.85%) ⬆️
...ad/transport/handler/MultiEntityResultHandler.java 91.89% <ø> (+78.37%) ⬆️
src/main/java/org/opensearch/ad/util/BulkUtil.java 71.42% <ø> (+54.28%) ⬆️
src/main/java/org/opensearch/ad/util/MathUtil.java 100.00% <ø> (ø)
...rg/opensearch/ad/util/ThrowingSupplierWrapper.java 100.00% <ø> (+60.00%) ⬆️
...n/java/org/opensearch/ad/ml/EntityColdStarter.java 81.51% <100.00%> (+2.60%) ⬆️
...pensearch/ad/settings/AnomalyDetectorSettings.java 100.00% <100.00%> (ø)
...arch/ad/transport/EntityResultTransportAction.java 86.44% <100.00%> (-0.12%) ⬇️
... and 23 more

@kaituo kaituo merged commit 1d0b719 into opensearch-project:main Aug 19, 2021
ohltyler pushed a commit to ohltyler/anomaly-detection-2 that referenced this pull request Sep 1, 2021
First, this PR adds an empty string check in PriorityCache.
Second, in EntityColdStarter, this PR clears samples after using them for training.
Third, this PR removes unused fields and local variables in ModelManager and BulkUtil.
Fourth, this PR decreases the concurrent preview from 5 to 2, with a conservative purpose to reduce potential GC.
Fifth, this PR finishes unit tests owed due to my previous PRs. 99% code of the PR is about tests.

Testing done:
1. Added unit tests.
2. made sure the basic e2e workflow still works.
ohltyler pushed a commit to ohltyler/anomaly-detection-2 that referenced this pull request Sep 1, 2021
First, this PR adds an empty string check in PriorityCache.
Second, in EntityColdStarter, this PR clears samples after using them for training.
Third, this PR removes unused fields and local variables in ModelManager and BulkUtil.
Fourth, this PR decreases the concurrent preview from 5 to 2, with a conservative purpose to reduce potential GC.
Fifth, this PR finishes unit tests owed due to my previous PRs. 99% code of the PR is about tests.

Testing done:
1. Added unit tests.
2. made sure the basic e2e workflow still works.
ohltyler pushed a commit that referenced this pull request Sep 1, 2021
First, this PR adds an empty string check in PriorityCache.
Second, in EntityColdStarter, this PR clears samples after using them for training.
Third, this PR removes unused fields and local variables in ModelManager and BulkUtil.
Fourth, this PR decreases the concurrent preview from 5 to 2, with a conservative purpose to reduce potential GC.
Fifth, this PR finishes unit tests owed due to my previous PRs. 99% code of the PR is about tests.

Testing done:
1. Added unit tests.
2. made sure the basic e2e workflow still works.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants