-
Notifications
You must be signed in to change notification settings - Fork 94
Add stats tracking for semantic field #1362
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
Conversation
Signed-off-by: Bo Zhang <[email protected]>
Signed-off-by: Bo Zhang <[email protected]>
fa40c43
to
777a5b9
Compare
Could you include an example of the new API response in the PR description? |
src/main/java/org/opensearch/neuralsearch/processor/semantic/SemanticFieldProcessor.java
Show resolved
Hide resolved
src/main/java/org/opensearch/neuralsearch/processor/semantic/SemanticFieldProcessor.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/neuralsearch/stats/events/EventStatName.java
Outdated
Show resolved
Hide resolved
f491352
to
5eade10
Compare
src/main/java/org/opensearch/neuralsearch/processor/semantic/SemanticFieldProcessor.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/neuralsearch/query/NeuralQueryBuilder.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/neuralsearch/stats/events/EventStatName.java
Outdated
Show resolved
Hide resolved
Could you update the neural query integ tests to verify the stats are only incremented once for each query type? |
src/main/java/org/opensearch/neuralsearch/processor/semantic/SemanticFieldProcessor.java
Outdated
Show resolved
Hide resolved
Currently we cannot run integ tests for the semantic field related use cases. I think we can address in a separate PR where we add the integ tests for semantic fields. |
src/main/java/org/opensearch/neuralsearch/stats/events/EventStatName.java
Outdated
Show resolved
Hide resolved
For neural query request count against sparse/dense, don't those stats work without semantic field? |
12579dd
to
abbb5e2
Compare
ok added |
public void testQueryWithBoostAndImageQueryAndRadialQuery() { | ||
// Enable stats for the test | ||
updateClusterSettings(NEURAL_STATS_ENABLED.getKey(), true); |
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.
Could we have this a separate testQueryWithBoostAndImageQueryAndRadialQuery_statsEnabled()
test? Following the pattern of the other stats ITs. So we can validate both stats disabled and stats enabled happy case. Same with the neural sparse test.
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 think it's not necessary to test stats disabled everywhere. One test to cover that should already be good enough since the disable logic is not related to this PR.
@@ -173,7 +176,10 @@ private void process( | |||
) { | |||
setModelInfo(ingestDocument, semanticFieldInfoList); | |||
|
|||
chunk(ingestDocument, semanticFieldInfoList); | |||
boolean shouldRecordChunking = chunk(ingestDocument, semanticFieldInfoList); |
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.
[nit] chunk method simply returns whether the chunk is enabled or disabled. The variable name should reflect this behavior only in my opinion.
boolean chunked = chunk(ingestDocument, semanticFieldInfoList);
if (chunked) {
EventStatsManager.increment(EventStatName.SEMANTIC_FIELD_PROCESSOR_CHUNKING_EXECUTIONS);
}
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.
ok
Signed-off-by: Bo Zhang <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1362 +/- ##
============================================
- Coverage 82.47% 0 -82.48%
============================================
Files 149 0 -149
Lines 7531 0 -7531
Branches 1211 0 -1211
============================================
- Hits 6211 0 -6211
+ Misses 859 0 -859
+ Partials 461 0 -461 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Description
Add stats tracking for semantic field
Below is an example response for create, index and query semantic field with sparse model.
Related Issues
N/A
Check List
--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.