Skip to content
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

fix(mango): communicate rows read for global stats collection #4908

Merged
merged 1 commit into from
Jan 9, 2024

Conversation

pgj
Copy link
Contributor

@pgj pgj commented Dec 10, 2023

Besides the execution statistics that could be shown for the user, the number of rows and documents read are tracked separately on the global level. (Which is more like a bug than a feature, but that is out of the scope of this change.)

With the introduction of covering indexes, these two have been become different, therefore global counting has to be taught about the number of times when no documents were read but rows only. For text indexes, the number of rows and documents should be the same, the distinction makes sense only for json indexes.

Testing recommendations

The changes are covered by the respective portion of the tests:

make eunit apps=mango
make mango-test

The global stats should always report the same values as it is added for the (Mango) execution stats.

Checklist

  • Code is written and works correctly
  • Changes are covered by tests

@pgj pgj force-pushed the fix/mango/chttpd_stats-integration branch from fc0f16d to 5bbefac Compare December 10, 2023 10:29
Copy link
Contributor

@iilyak iilyak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@pgj pgj force-pushed the fix/mango/chttpd_stats-integration branch from 5bbefac to 519305b Compare December 14, 2023 14:00
?assertEqual(3, meck:num_calls(couch_stats, increment_counter, 1)),
?assertEqual(3, meck:num_calls(mango_execution_stats, incr_docs_examined, 1)),
?assertEqual(3, meck:num_calls(mango_execution_stats, incr_results_returned, 1)).
meck:expect(chttpd_stats, incr_rows, [0], meck:val(ok)),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iilyak, @chewbranca please note that text search will not modify the rows value. Is this acceptable or shall they also update the value? If yes, how?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have talked about this with @willholley and @mikerhodes offline. The conclusion was that rows should be equal to reads for text indexes. The distinction between these two categories make difference only for json indexes, especially when covering indexes are in use.

@pgj pgj force-pushed the fix/mango/chttpd_stats-integration branch 2 times, most recently from 14214d6 to 13477b2 Compare December 16, 2023 14:08
@pgj pgj marked this pull request as ready for review December 17, 2023 10:08
Besides the execution statistics that could be shown for the user,
the number of rows and documents read are tracked separately on
the global level.  (Which is more like a bug than a feature, but
that is out of the scope of this change.)

With the introduction of covering indexes, these two have been
become different, therefore global counting has to be taught about
the number of times when no documents were read but rows only.  For
text indexes, the number of rows and documents should be the same,
the distinction makes sense only for json indexes.
@pgj pgj force-pushed the fix/mango/chttpd_stats-integration branch from 13477b2 to 33c9881 Compare January 9, 2024 11:05
@pgj pgj merged commit 4f3dc95 into apache:main Jan 9, 2024
14 checks passed
@pgj pgj deleted the fix/mango/chttpd_stats-integration branch January 9, 2024 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants