Instrumentalize code to measure latency and QPS (and save results) #2266
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Here’s a pull request to add instrumentation to anserini and try to make latency/qps measuring standardized and a part of the retrieval. It basically stores the retrieval latencies and then computes average, median and p99 latency and stores in a file. Note that these are “best effort” latencies as you get the result before it is pretreated by Lucene in order to make it readable, but they are not exactly the server latency (imagine a server running Lucene and you are outside of it, it would be the latency including packet traffic but not result parsing).
Testing with arguana based on: https://github.com/cadurosar/anserini/blob/instrumentalize/docs/regressions/regressions-beir-v1.0.0-arguana-splade-distil-cocodenser-medium.md:
Without instrumentation:
Only information on QPS, need to read logs to get it.
With instrumentation:
Has latency information and creates a file which is the run name + _Efficiency. On this example "runs/run.beir-v1.0.0-arguana-splade_distil_cocodenser_medium.splade_distil_cocodenser_medium.topics.beir-v1.0.0-arguana.test.splade_distil_cocodenser_medium.txt_Efficiency"
This is just a first version, tell me what you think @lintool @ArthurChen189