-
Notifications
You must be signed in to change notification settings - Fork 56
Add stats for custom scoring feature #233
Add stats for custom scoring feature #233
Conversation
/** | ||
* Test checks that script stats are properly updated | ||
*/ | ||
public void testScriptStats() throws Exception { |
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.
Can we add similar test with multiple shards?
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.
Sure
#### script_query_requests | ||
The number of query requests that use the k-NN score script. | ||
|
||
#### script_query_errors |
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 these errors are counted at shard level. We could update the documentation accordingly. Also you might want to check if all the above metrics at shard level or index level
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.
Yes, they are at shard level. I updated README
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.
LGTM! Thanks for the stats.
Issue #, if available:
Description of changes:
Adds a few statistics for custom scoring feature. The following statistics are added:
script_compilations
The number of times the knn script is compiled. This value should only be 0 or 1 most of the time. However, if the cache containing the compiled scripts is filled, it may cause the script to be recompiled.
script_compilation_errors
The number of errors during script compilation.
script_query_requests
The number of query requests that use the k-NN score script.
script_query_errors
The number of errors that have occurred during use of the k-NN score script.
Along with adding the stats, I updated the README and added another stats integration test to verify the changes.
I think in the future, it will probably make sense to refactor the stats api into different sections for custom scoring and approximate k Nearest Neighbor search. I will create an issue to do this.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.