Skip to content

Add a counter of total query execution time - [MOD-7961]#5145

Merged
GuyAv46 merged 5 commits intomasterfrom
guyav-metrics_latency
Nov 4, 2024
Merged

Add a counter of total query execution time - [MOD-7961]#5145
GuyAv46 merged 5 commits intomasterfrom
guyav-metrics_latency

Conversation

@GuyAv46
Copy link
Collaborator

@GuyAv46 GuyAv46 commented Nov 3, 2024

Describe the changes in the pull request

Add a counter for the total number of ms spent running a query.
We don't count internal queries (cluster mode), but we count the time we wait for them to return.

When using BG workers, we also count the time we wait in the workers' queue.

This new info counter (search_total_query_execution_time_ms) is useful when paired with the queries/query commands counters, to calculate the average query/command latency.

Mark if applicable

  • This PR introduces API changes
  • This PR introduces serialization changes

@codecov
Copy link

codecov bot commented Nov 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.36%. Comparing base (8cffbb6) to head (a6c48cf).
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5145      +/-   ##
==========================================
+ Coverage   86.33%   86.36%   +0.02%     
==========================================
  Files         190      190              
  Lines       34614    34642      +28     
==========================================
+ Hits        29884    29917      +33     
+ Misses       4730     4725       -5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@fcostaoliveira
Copy link
Contributor

fcostaoliveira commented Nov 3, 2024

Automated performance analysis summary

This comment was automatically generated given there is performance data available.

In summary:

  • Detected a total of 30 stable tests between versions.
  • Detected a total of 6 highly unstable benchmarks.
  • Detected a total of 4 improvements above the improvement water line.
  • Detected a total of 3 regressions bellow the regression water line 5.0.

You can check a comparison in detail via the grafana link

Comparison between master and guyav-metrics_latency.

Time Period from 30 days ago. (environment used: oss-standalone)

Test Case Baseline master (median obs. +- std.dev) Comparison guyav-metrics_latency (median obs. +- std.dev) % change (higher-better) Note
ftsb-10K-enwiki_abstract-hashes-fulltext-sortby 69 +- 2.9% (7 datapoints) 71.00 2.5% No Change
ftsb-10K-enwiki_abstract-hashes-term-prefix 7430 +- 5.9% (7 datapoints) 7490.00 0.8% waterline=5.9%. No Change
ftsb-10K-enwiki_abstract-hashes-term-suffix 2053 +- 2.0% (7 datapoints) 2084.00 1.5% No Change
ftsb-10K-enwiki_abstract-hashes-term-suffix-withsuffixtrie 70247 +- 4.8% (7 datapoints) 56146.00 -20.1% REGRESSION
ftsb-10K-enwiki_abstract-hashes-term-wildcard 11968 +- 6.0% (7 datapoints) 12551.00 4.9% waterline=6.0%. potential IMPROVEMENT
ftsb-10K-enwiki_pages-hashes-fulltext-mixed_simple-1word-query_write_1_to_read_20.yml 1269 +- 5.3% (7 datapoints) 1301.00 2.5% waterline=5.3%. No Change
ftsb-10K-enwiki_pages-hashes-load 45797 +- 5.7% (7 datapoints) 46493.00 1.5% waterline=5.7%. No Change
ftsb-10K-multivalue-numeric-json 804 +- 2.2% (7 datapoints) 835.00 3.8% potential IMPROVEMENT
ftsb-10K-singlevalue-numeric-json 332 +- 1.7% (7 datapoints) 348.00 4.8% potential IMPROVEMENT
ftsb-1K-enwiki_abstract-hashes-term-contains 1750 +- 3.2% (7 datapoints) 1783.00 1.9% No Change
ftsb-1M-enwiki_abstract-hashes-fulltext-2word-intersection-query 381 +- 5.6% (7 datapoints) 392.00 2.6% waterline=5.6%. No Change
ftsb-1M-enwiki_abstract-hashes-fulltext-2word-intersection-query-non-sortable 42 +- 7.1% (7 datapoints) 45.00 6.0% waterline=7.1%. potential IMPROVEMENT
ftsb-1M-enwiki_abstract-hashes-fulltext-2word-intersection-query@100_ops_sec 100 +- 0.0% (7 datapoints) 100.00 0.0% No Change
ftsb-1M-enwiki_abstract-hashes-fulltext-2word-union-query 2752 +- 9.0% (7 datapoints) 2869.00 4.3% waterline=9.0%. potential IMPROVEMENT
ftsb-1M-enwiki_abstract-hashes-fulltext-2word-union-query-non-sortable 1004 +- 9.5% (7 datapoints) 1146.00 14.1% waterline=9.5%. IMPROVEMENT
ftsb-1M-enwiki_abstract-hashes-fulltext-2word-union-query@100_ops_sec 100 +- 0.0% (7 datapoints) 100.00 0.0% No Change
ftsb-1M-enwiki_abstract-hashes-fulltext-simple-1word-query 932 +- 12.5% UNSTABLE (7 datapoints) 1083.00 16.2% UNSTABLE (very high variance)
ftsb-1M-enwiki_abstract-hashes-fulltext-simple-1word-query@100_ops_sec 100 +- 0.0% (7 datapoints) 100.00 -0.1% No Change
ftsb-1M-enwiki_abstract-hashes-load 21654 +- 4.6% (7 datapoints) 22304.00 3.0% No Change
ftsb-1M-nyc_taxis-ftadd-load 18211 +- 1.8% (7 datapoints) 18707.00 2.7% No Change
ftsb-1M-nyc_taxis-hashes-load 19373 +- 2.8% (7 datapoints) 19860.00 2.5% No Change
search-aggregate-post-filter-simple.yml 96002 +- 3.1% (7 datapoints) 85138.00 -11.3% REGRESSION
search-expire-doc-10-milliseconds 0.61 +- 2.3% (2 datapoints) 0.62 1.6% No Change
search-filtering-tag-numeric 199 +- 19.2% UNSTABLE (7 datapoints) 186.00 -6.5% UNSTABLE (very high variance)
search-filtering-tag-numeric-filter-pipeline 19299 +- 2.1% (7 datapoints) 18556.00 -3.9% potential REGRESSION
search-ftsb-10K-enwiki_abstract-hashes-term-withoutsuffix-trie 40824 +- 1.6% (7 datapoints) 37502.00 -8.1% REGRESSION
search-ftsb-10K-enwiki_abstract-hashes-term-withsuffix-trie 39243 +- 3.8% (7 datapoints) 39053.00 -0.5% No Change
search-ftsb-1700K-docs-union-iterators-q3 6.2 +- 2.0% (7 datapoints) 6.40 3.4% potential IMPROVEMENT
search-ftsb-1M-enwiki_abstract-hashes-fulltext-2word-intersection-query-non-sortable@50_ops_sec 50 +- 1.9% (7 datapoints) 50.00 0.2% No Change
search-ftsb-1M-enwiki_abstract-hashes-fulltext-2word-union-query-non-sortable@100_ops_sec 100 +- 0.0% (7 datapoints) 100.00 -0.0% No Change
search-ftsb-1M-enwiki_abstract-hashes-fulltext-simple-1word-query-non-sortable 155 +- 5.4% (7 datapoints) 156.00 0.5% waterline=5.4%. No Change
search-ftsb-370K-docs-union-iterators-q4 6.4 +- 2.0% (7 datapoints) 6.70 3.6% potential IMPROVEMENT
search-geo 182 +- 3.0% (7 datapoints) 188.00 3.3% potential IMPROVEMENT
search-high-cardinality-negation-term-comparison_union_all_other_terms 7.0 +- 3.5% (7 datapoints) 7.60 8.6% IMPROVEMENT
search-numeric 3100 +- 30.0% UNSTABLE (7 datapoints) 5112.00 64.9% UNSTABLE (very high variance)
search-numeric-optimize 9272 +- 2.1% (7 datapoints) 9164.00 -1.2% No Change
search-numeric-sortby 2985 +- 28.7% UNSTABLE (7 datapoints) 3150.00 5.5% UNSTABLE (very high variance)
search-numeric-sortby-desc 2959 +- 23.9% UNSTABLE (7 datapoints) 3494.00 18.1% UNSTABLE (very high variance)
search-numeric-sortby-desc-optimize 48 +- 19.3% UNSTABLE (7 datapoints) 49.00 1.7% UNSTABLE (very high variance)
search-numeric-sortby-optimize 20 +- 3.0% (7 datapoints) 20.00 2.6% No Change
vecsim-arxiv-titles-384-angular-filters-m16-ef-128-fulltext-filter 480 +- 5.0% (7 datapoints) 520.00 8.3% IMPROVEMENT
vecsim-arxiv-titles-384-angular-filters-m16-ef-128-numeric-filter 105 +- 9.1% (7 datapoints) 118.00 12.6% waterline=9.1%. IMPROVEMENT
vecsim-arxiv-titles-384-angular-filters-m16-ef-128-tag-filter 57935 +- 2.9% (7 datapoints) 55133.00 -4.8% potential REGRESSION

@GuyAv46 GuyAv46 enabled auto-merge November 4, 2024 12:27
@GuyAv46 GuyAv46 added this pull request to the merge queue Nov 4, 2024
Merged via the queue into master with commit 97f34e2 Nov 4, 2024
@GuyAv46 GuyAv46 deleted the guyav-metrics_latency branch November 4, 2024 14:04
@redisearch-backport-pull-request
Copy link
Contributor

Backport failed for 2.10, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin 2.10
git worktree add -d .worktree/backport-5145-to-2.10 origin/2.10
cd .worktree/backport-5145-to-2.10
git switch --create backport-5145-to-2.10
git cherry-pick -x 97f34e2e0bb5fccac06fa61144dd3882ae07741a

redisearch-backport-pull-request bot pushed a commit that referenced this pull request Nov 4, 2024
* complete CP of "Count Queries" (#5072) content

* always count query execution time (on non-internal commands)

* add test

* give more time

* review fixes

(cherry picked from commit 97f34e2)
@redisearch-backport-pull-request
Copy link
Contributor

Successfully created backport PR for 8.0:

GuyAv46 added a commit that referenced this pull request Nov 4, 2024
* complete CP of "Count Queries" (#5072) content

* always count query execution time (on non-internal commands)

* add test

* give more time

* review fixes

(cherry picked from commit 97f34e2)
github-merge-queue bot pushed a commit that referenced this pull request Nov 4, 2024
Add a counter of total query execution time - [MOD-7961] (#5145)

* complete CP of "Count Queries" (#5072) content

* always count query execution time (on non-internal commands)

* add test

* give more time

* review fixes

(cherry picked from commit 97f34e2)

Co-authored-by: GuyAv46 <[email protected]>
github-merge-queue bot pushed a commit that referenced this pull request Nov 4, 2024
* Add a counter of total query execution time - [MOD-7961] (#5145)

* complete CP of "Count Queries" (#5072) content

* always count query execution time (on non-internal commands)

* add test

* give more time

* review fixes

(cherry picked from commit 97f34e2)

* add missing if
alonre24 pushed a commit that referenced this pull request Dec 27, 2024
* Add a counter of total query execution time - [MOD-7961] (#5145)

* complete CP of "Count Queries" (#5072) content

* always count query execution time (on non-internal commands)

* add test

* give more time

* review fixes

(cherry picked from commit 97f34e2)

* add missing if

(cherry picked from commit d45365d)
github-merge-queue bot pushed a commit that referenced this pull request Jan 1, 2025
* CP Count Queries - [MOD-6492]

* [2.10] Add metrics of min and max memory consumption of indexes - [MOD-7584] (#5146)

Add metrics of min and max memory consumption of indexes - [MOD-7584] (#5143)

* implement min and max memory usage metrics

* added to info module test

(cherry picked from commit b0d56ad)

Co-authored-by: GuyAv46 <[email protected]>
(cherry picked from commit 094318f)

* [2.10] Add a counter of total query execution time - [MOD-7961] (#5153)

* Add a counter of total query execution time - [MOD-7961] (#5145)

* complete CP of "Count Queries" (#5072) content

* always count query execution time (on non-internal commands)

* add test

* give more time

* review fixes

(cherry picked from commit 97f34e2)

* add missing if

(cherry picked from commit d45365d)

* CP [MOD-8034] expose indexing failures to INFO modules

* [2.10] Add VecSim related metrics - [MOD-7967] (#5169)

Add VecSim related metrics - [MOD-7967] (#5151)

* added vector info

* added a test

* drain work queue before checking memory

* move vector metrics info field statistics section

* fix test

* fix test

* tidy up

* added a flat index to the test

(cherry picked from commit 388f81e)

Co-authored-by: GuyAv46 <[email protected]>
(cherry picked from commit 242f314)

* CP Add Active Indices Metrics - [MOD-7952]

* CP Add global marked deleted to stats [MOD-6053]

* CP Fork gc code cleanup (PR #4263) to enable GC mechanism that will allow the test of marked deleted info to pass

* CP [MOD-8152] rename and move new metrics

* CP [MOD-8035] Add field index error for JSON field indexing failures

* CP [MOD-8039] Reorganize stats files

* [2.10] Improve counting active writes - [MOD-8151] (#5362)

Improve counting active writes - [MOD-8151] (#5354)

* improve counting active writes

* add a test

(cherry picked from commit 2b5182d)

Co-authored-by: GuyAv46 <[email protected]>
(cherry picked from commit a3d447d)

* Update mem usage computation to align to 2.10

* revert bad additions (CR)

* revert bad additions (CR) 2

* Better memory check in info vecsim (since mac failed)

* Fix syntax error

---------

Co-authored-by: redisearch-backport-pull-request[bot] <182669528+redisearch-backport-pull-request[bot]@users.noreply.github.com>
Co-authored-by: GuyAv46 <[email protected]>
Co-authored-by: meiravgri <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants