Skip to content

feat(search): track record usage metrics and add popularity sort modes - #1708

Merged
paralta merged 9 commits into
mainfrom
feat/record-popularity
Jun 29, 2026
Merged

paralta merged 9 commits into
mainfrom
feat/record-popularity

Conversation

@paralta

@paralta paralta commented Jun 26, 2026

Copy link
Copy Markdown
Member

This PR introduces a record_usage_metrics table that accumulates per-record usage signals (pull_count, lookup_count, provider_count) and exposes them as sort modes on SearchService.

  • Pull counts are incremented directly in StoreService.Pull; lookup counts in StoreService.Lookup.
  • Provider count — the number of DHT peers currently announcing a CID — is a point-in-time gauge refreshed by a new metrics reconciler task. Because the routing layer uses an embedded Badger store that only supports a single writer, the standalone reconciler queries provider count over a dedicated RoutingService.GetProviderCount gRPC RPC rather than reading the datastore directly; it requires server_address to be configured for this task to run.

@github-actions

github-actions Bot commented Jun 26, 2026 •

Copy link
Copy Markdown
Contributor

The latest Buf updates on your PR. Results from workflow Buf CI / verify-proto (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed⏩ skipped⏩ skipped✅ passedJun 29, 2026, 8:28 AM

@github-actions github-actions Bot added the size/M Denotes a PR that changes 200-999 lines label Jun 26, 2026
Comment thread reconciler/config/config.go Resolved
@paralta
paralta marked this pull request as ready for review June 26, 2026 13:19
@paralta
paralta requested a review from a team as a code owner June 26, 2026 13:19
Comment thread reconciler/tasks/metrics/grpc.go Resolved
@paralta
paralta force-pushed the feat/record-popularity branch from 01945e4 to 10fb898 Compare June 26, 2026 14:41
@paralta
paralta force-pushed the feat/record-popularity branch from 10fb898 to d3af749 Compare June 29, 2026 08:28
@paralta
paralta requested a review from ramizpolic June 29, 2026 08:42
@paralta
paralta merged commit 50b5a39 into main Jun 29, 2026
34 checks passed
@paralta
paralta deleted the feat/record-popularity branch June 29, 2026 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M Denotes a PR that changes 200-999 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Track download counts and provider distribution to power the most-popular sort mode

2 participants