opendistro-for-elasticsearch / k-NN

🆕 A machine learning plugin which supports an approximate k-NN search algorithm for Open Distro.
https://opendistro.github.io/
Apache License 2.0
277 stars 55 forks source link

Add stats for custom scoring feature #233

Closed jmazanec15 closed 4 years ago

jmazanec15 commented 4 years ago

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.