fix(cadastre): count snapshot+per-cat requests in cadastre_jobs.requests_count #182
No reviewers
Labels
No labels
admin
analytics
auth
automation
bug
business
chore
ci
compliance
data
data-moat
docs
duplicate
dx
enhancement
Fable 5 ревью
feedback/max
generative
GG-форсайт
needs-discussion
needs-human
observability
pause-bots
performance
priority/p0
priority/p1
priority/p2
priority/p3
scope/backend
scope/db
scope/devops
scope/frontend
scope/qa
scrapers
security
site-finder
stage/1
stage/2
status/blocked
status/done
status/needs-analysis
status/needs-fix
status/qa
status/ready
status/review
status/wip
tech-debt
tradein
ux
week ревью 1
wontfix
вторичка
ИРД
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lekss361/gendesign#182
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "fix/cadastre-metrics-snapshot-count"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Fix metrics bug:
cadastre_jobs.requests_countpreviously counted ONLYgrid_walk_requests, so:ekb_fulljob #8 reported 4950 reqs while real total was ~14000+ (2408 quarters × snapshot + per-cat probes from #180)Changes
HarvestResult.snapshot_requests— increments at Phase 1 (1 search) + Phase 1.5 (per-cat probes from #180)HarvestResult.total_requestsproperty —snapshot_requests + grid_walk_requestsbulk_harvest_quarter_taskwritestotal_requeststocadastre_jobs.requests_countWhy this matters
Without accurate request count, можно easily:
requests_count=0despite 50 quarters worth of NSPD workTest plan
pytest tests/services/test_cadastre_bulk.py→ 29 passed (added 1 new + 1 assertion in existing)cadastre_jobs.requests_countshould ≈targets_total × (1 + avg per-cat probes + avg grid-walks/quarter).Closes part of #168.
Review
CI зелёный (backend 1m24s + frontend 1m34s) + cross-check (agent):
✅ Increment correctness
bulk_harvest.py:136):result.snapshot_requests += 1послеawait— на raise increment скипается + propagates правильно.bulk_harvest.py:189): increment insidetry, на raise —exceptswallow +continue→ не считается.total_requests = snapshot + grid_walk— disjoint counters, no double-count.✅ Worker switch
scrape_cadastre.py:225—requests_count_inc=result_dict.get("total_requests", 0)с защитным дефолтом. Оба counters returned в result_dict для observability.✅ Backward-compat
HarvestResultserver-only dataclass; новое поле default=0.grid_walk_requestsсохранено — grep подтвердил, нет внешних consumers (только bulk_harvest.py + scrape_cadastre.py + tests).✅ Test coverage
test_harvest_result_total_requests_property— direct property арифметика (3+225=228 + default 0).test_harvest_quarter_calls_upsert_featuresaugmented с assertionssnapshot_requests=1, grid_walk_requests=0, total_requests=1.✅ No conflict с PR #181
✅ Drift отсутствует
HarvestResultserver-side only, no TS callers.approve merge