MCPcopy Create free account
hub / github.com/antgroup/vsag / TestHGraphSearchOverTime

Function TestHGraphSearchOverTime

tests/test_hgraph.cpp:2213–2250  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2211}
2212
2213static void
2214TestHGraphSearchOverTime(const fixtures::HGraphTestIndexPtr& test_index,
2215 const fixtures::HGraphResourcePtr& resource) {
2216 using namespace fixtures;
2217 auto origin_size = vsag::Options::Instance().block_size_limit();
2218 auto size = GENERATE(1024 * 1024 * 2);
2219 constexpr const char* search_param = R"({
2220 "hgraph": {
2221 "ef_search": 200,
2222 "timeout_ms": 5.0
2223 }
2224 })";
2225 for (auto metric_type : resource->metric_types) {
2226 for (auto dim : resource->dims) {
2227 for (auto& [base_quantization_str, recall] : resource->test_cases) {
2228 INFO(fmt::format("metric_type: {}, dim: {}, base_quantization_str: {}, recall: {}",
2229 metric_type,
2230 dim,
2231 base_quantization_str,
2232 recall));
2233 if (HGraphTestIndex::IsRaBitQ(base_quantization_str) &&
2234 dim < fixtures::RABITQ_MIN_RACALL_DIM) {
2235 dim = fixtures::RABITQ_MIN_RACALL_DIM;
2236 }
2237 vsag::Options::Instance().set_block_size_limit(size);
2238 HGraphTestIndex::HGraphBuildParam build_param(
2239 metric_type, dim, base_quantization_str);
2240 auto param = HGraphTestIndex::GenerateHGraphBuildParametersString(build_param);
2241 auto index = TestIndex::TestFactory(test_index->name, param, true);
2242 auto dataset = HGraphTestIndex::pool.GetDatasetAndCreate(
2243 dim, resource->base_count, metric_type);
2244 TestIndex::TestBuildIndex(index, dataset, true);
2245 TestIndex::TestSearchOvertime(index, dataset, search_param);
2246 vsag::Options::Instance().set_block_size_limit(origin_size);
2247 }
2248 }
2249 }
2250}
2251
2252TEST_CASE("(PR) HGraph Search Over Time", "[ft][hgraph][pr]") {
2253 auto test_index = std::make_shared<fixtures::HGraphTestIndex>();

Callers 1

test_hgraph.cppFile · 0.85

Calls 3

block_size_limitMethod · 0.80
set_block_size_limitMethod · 0.80
GetDatasetAndCreateMethod · 0.80

Tested by

no test coverage detected