Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BucketLevelMonitor] Multi-term agg support #964

Merged
merged 3 commits into from
Jul 11, 2023

Conversation

petardz
Copy link
Contributor

@petardz petardz commented Jun 18, 2023

*Issue #, if available: #798

Description of changes:

CheckList:
[ ] 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.

@codecov
Copy link

codecov bot commented Jun 18, 2023

Codecov Report

Merging #964 (42cc139) into main (62d2524) will decrease coverage by 0.26%.
The diff coverage is 0.00%.

❗ Current head 42cc139 differs from pull request most recent head 79a1a82. Consider uploading reports for the commit 79a1a82 to get more accurate results

@@             Coverage Diff              @@
##               main     #964      +/-   ##
============================================
- Coverage     75.05%   74.79%   -0.26%     
  Complexity      111      111              
============================================
  Files           144      144              
  Lines          8341     8343       +2     
  Branches       1213     1215       +2     
============================================
- Hits           6260     6240      -20     
- Misses         1465     1485      +20     
- Partials        616      618       +2     
Impacted Files Coverage Δ
...ain/kotlin/org/opensearch/alerting/AlertService.kt 80.28% <0.00%> (-0.29%) ⬇️
...n/kotlin/org/opensearch/alerting/TriggerService.kt 77.58% <0.00%> (-2.78%) ⬇️

... and 7 files with indirect coverage changes

@petardz petardz force-pushed the mutli-term-agg-fix branch from 6f830a1 to eda83f5 Compare June 21, 2023 22:48
val searchResult = (output.objectMap("input_results")["results"] as List<Map<String, Any>>).first()
@Suppress("UNCHECKED_CAST")
val buckets = searchResult.stringMap("aggregations")?.stringMap("hot")?.get("buckets") as List<Map<String, Any>>
assertEquals("Incorrect search result", 2, buckets.size)
Copy link
Member

Choose a reason for hiding this comment

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

Should we check the result to ensure its getting the right values?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@petardz petardz force-pushed the mutli-term-agg-fix branch from 42cc139 to 79a1a82 Compare June 28, 2023 19:16
@lezzago lezzago added backport 2.x backport 2.9 backports PRs to 2.9 labels Jul 11, 2023
@lezzago lezzago merged commit a3db266 into opensearch-project:main Jul 11, 2023
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jul 11, 2023
* added handling of multi-term agg in bucketlevel monitors

Signed-off-by: Petar Dzepina <[email protected]>

* added handling of multi-term agg in bucketlevel monitors

Signed-off-by: Petar Dzepina <[email protected]>

* added more asserts

Signed-off-by: Petar Dzepina <[email protected]>

---------

Signed-off-by: Petar Dzepina <[email protected]>
(cherry picked from commit a3db266)
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jul 11, 2023
* added handling of multi-term agg in bucketlevel monitors

Signed-off-by: Petar Dzepina <[email protected]>

* added handling of multi-term agg in bucketlevel monitors

Signed-off-by: Petar Dzepina <[email protected]>

* added more asserts

Signed-off-by: Petar Dzepina <[email protected]>

---------

Signed-off-by: Petar Dzepina <[email protected]>
(cherry picked from commit a3db266)
AWSHurneyt pushed a commit that referenced this pull request Jul 11, 2023
* added handling of multi-term agg in bucketlevel monitors

Signed-off-by: Petar Dzepina <[email protected]>

* added handling of multi-term agg in bucketlevel monitors

Signed-off-by: Petar Dzepina <[email protected]>

* added more asserts

Signed-off-by: Petar Dzepina <[email protected]>

---------

Signed-off-by: Petar Dzepina <[email protected]>
(cherry picked from commit a3db266)

Co-authored-by: Petar Dzepina <[email protected]>
AWSHurneyt pushed a commit that referenced this pull request Jul 11, 2023
* added handling of multi-term agg in bucketlevel monitors

Signed-off-by: Petar Dzepina <[email protected]>

* added handling of multi-term agg in bucketlevel monitors

Signed-off-by: Petar Dzepina <[email protected]>

* added more asserts

Signed-off-by: Petar Dzepina <[email protected]>

---------

Signed-off-by: Petar Dzepina <[email protected]>
(cherry picked from commit a3db266)

Co-authored-by: Petar Dzepina <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x backport 2.9 backports PRs to 2.9
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants