fix: coverage_pct and ram_estimate use points_count (vectors_count deprecated in Qdrant v1.x)
This commit is contained in:
@@ -236,14 +236,16 @@ def inspect():
|
|||||||
quant = cfg.quantization_config
|
quant = cfg.quantization_config
|
||||||
params = cfg.params
|
params = cfg.params
|
||||||
|
|
||||||
# Estimate raw RAM footprint: vectors * dim * 4 bytes * 1.5 safety factor
|
# `vectors_count` is deprecated and returns 0 in newer Qdrant versions;
|
||||||
vec_count = info.vectors_count or 0
|
# use `points_count` as the canonical count for coverage and RAM estimates.
|
||||||
|
points_count = info.points_count or 0
|
||||||
|
vec_count = info.vectors_count or points_count # kept for backwards compat display
|
||||||
vec_dim = (
|
vec_dim = (
|
||||||
params.vectors.size
|
params.vectors.size
|
||||||
if hasattr(params.vectors, "size")
|
if hasattr(params.vectors, "size")
|
||||||
else VECTOR_DIM
|
else VECTOR_DIM
|
||||||
)
|
)
|
||||||
ram_estimate_mb = round(vec_count * vec_dim * 4 * 1.5 / 1_048_576, 1)
|
ram_estimate_mb = round(points_count * vec_dim * 4 * 1.5 / 1_048_576, 1)
|
||||||
|
|
||||||
result[name] = {
|
result[name] = {
|
||||||
"status": info.status.value if info.status else None,
|
"status": info.status.value if info.status else None,
|
||||||
@@ -272,7 +274,7 @@ def inspect():
|
|||||||
k: {
|
k: {
|
||||||
"type": v.data_type.value if hasattr(v.data_type, "value") else str(v.data_type),
|
"type": v.data_type.value if hasattr(v.data_type, "value") else str(v.data_type),
|
||||||
"points": v.points,
|
"points": v.points,
|
||||||
"coverage_pct": round(v.points / max(vec_count, 1) * 100, 1),
|
"coverage_pct": round(v.points / max(points_count, 1) * 100, 1),
|
||||||
}
|
}
|
||||||
for k, v in (info.payload_schema or {}).items()
|
for k, v in (info.payload_schema or {}).items()
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user