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

Test posting list cache metrics. #4268

Merged
merged 1 commit into from
Nov 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions tests/search/metrics/metrics.rb
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,16 @@ def assert_document_db_disk_io(metrics)
def assert_document_db_cached_disk_io(metrics, expect_cached)
f1_cached_disk_io = get_cached_disk_io_for_field('f1', metrics)
puts "f1_cached_disk_io = " + f1_cached_disk_io.to_s
posting_list_cache_hit_rate = get_postinglist_cache_hit_rate(metrics)
puts "posting_list_cache_hit_rate = " + posting_list_cache_hit_rate.to_s
if expect_cached
assert(1000 < f1_cached_disk_io["sum"])
assert(0 < f1_cached_disk_io["count"])
assert(0 < posting_list_cache_hit_rate)
else
assert_equal(0, f1_cached_disk_io["sum"])
assert_equal(0, f1_cached_disk_io["count"])
assert_equal(0, posting_list_cache_hit_rate)
end
end

Expand All @@ -221,6 +225,10 @@ def get_cached_disk_io_for_field(field_name, metrics)
{"documenttype" => "test", "field" => field_name})
end

def get_postinglist_cache_hit_rate(metrics)
metrics.get('content.proton.index.cache.postinglist.hit_rate')['last']
end

def get_size_on_disk_for_attribute_field(field_name, metrics)
metrics.get('content.proton.documentdb.ready.attribute.size_on_disk',
{"documenttype" => "test", "field" => field_name})["last"]
Expand Down