Skip to content

Evaluate alternative provider measurement #518

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

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

pyropy
Copy link
Contributor

@pyropy pyropy commented Apr 9, 2025

This pull request introduces a new metric to track and report alternative provider retrieval statistics in addition to existing retrieval metrics. New metric is calculated based on the alternativeProviderRetrievalResult status. The alternativeProviderRetrievalResult field is evalulated using new fields introduced by CheckerNetwork/spark-checker#132. If new fields are not present in the reported measurement, evaluation falls back to using already present metric fields.

Changelog

Enhancements to retrieval tracking:

  • Added alternativeProviderRetrievalResult and alternativeProviderCheck properties to the Measurement class, and created the getAlternativeProviderRetrievalResult function to evaluate alternative provider retrieval metrics.
  • Added updateDailyAlternativeProviderRetrievalStats function to update daily alternative provider retrieval statistics and included its invocation in the updatePublicStats function.
  • Updated buildRetrievalStats to include alternative retrieval success rate calculations.
  • Added a new table daily_alternative_provider_retrieval_stats to store daily alternative provider retrieval statistics.
  • Updated test data and added new test cases to cover alternative provider retrieval statistics.

Closes #517
Related to:

@pyropy pyropy self-assigned this Apr 10, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 7 out of 8 changed files in this pull request and generated no comments.

Files not reviewed (1)
  • migrations/026.do.add-daily-network-retrieval-stats-table.sql: Language not supported
Comments suppressed due to low confidence (1)

lib/preprocess.js:20

  • Consider using getNetworkRetrievalResult(m) instead of getRetrievalResult(m) when setting networkRetrievalResult to ensure that network-specific logic is applied.
this.networkRetrievalResult = pointerize(getRetrievalResult(m))

@pyropy pyropy requested a review from Copilot April 10, 2025 11:01
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 8 out of 9 changed files in this pull request and generated no comments.

Files not reviewed (1)
  • migrations/026.do.add-daily-network-retrieval-stats-table.sql: Language not supported
Comments suppressed due to low confidence (2)

test/public-stats.test.js:1173

  • [nitpick] There is an extra trailing whitespace in the describe block title; consider removing it for consistency.
describe('updateDailyNetworkRetrievalStats ', () => {

lib/retrieval-stats.js:129

  • [nitpick] Ensure that using 'totalForRSR' as the denominator for the network success rate accurately reflects the intended measurement subset. If only measurements with network retrieval data should be considered, you might need to filter the denominator accordingly.
telemetryPoint.floatField('network_success_rate', networkRSR)

@pyropy pyropy marked this pull request as ready for review April 10, 2025 11:04
@pyropy pyropy changed the title WIP: Evaluate network wide measurement Evaluate network wide measurement Apr 10, 2025
Copy link
Member

@bajtos bajtos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look reasonable, but we need to figure out the naming and measurement payload in other pull requests first.

@@ -41,6 +42,13 @@ export class Measurement {
this.stationId = pointerize(m.station_id)
this.carChecksum = pointerize(m.car_checksum)
this.carTooLarge = m.car_too_large
this.networkRetrieval = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we agree to use a different name than "networkRetrieval", then we need to rename this property too.

See CheckerNetwork/spark-checker#132 (comment) and CheckerNetwork/spark-checker#132 (comment)

Plus, all other places that use the name "networkRetrieval" 😢

@juliangruber
Copy link
Member

The changes look reasonable, but we need to figure out the naming and measurement payload in other pull requests first.

+1 to figure out naming first.

Could you please link to the relevant PRs? I found CheckerNetwork/spark-checker#132 in your comment

@pyropy pyropy marked this pull request as draft April 15, 2025 16:32
@pyropy pyropy changed the title Evaluate network wide measurement Evaluate alternative provider measurement Apr 15, 2025
@pyropy
Copy link
Contributor Author

pyropy commented Apr 15, 2025

Should we evaluate alternative provider retrieval measurements separately using separate committees? There has been quite a few mentions of using pseudo-random number generation when picking alt provider in order to measurements into committees in CheckerNetwork/spark-checker#132.

cc @bajtos @juliangruber

@pyropy pyropy marked this pull request as ready for review April 15, 2025 17:25
@pyropy pyropy requested a review from bajtos April 15, 2025 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

Evaluate network wide retrievability check
3 participants