Skip to content
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

feat: add http rsr #18

Merged
merged 11 commits into from
Jan 14, 2025
Merged

feat: add http rsr #18

merged 11 commits into from
Jan 14, 2025

Conversation

NikolasHaimerl
Copy link
Contributor

This PR proposes the following changes:

  1. Add Http RSR to number of retrievals over time
  2. Add Http RSR to total number of retrievals in histograms (total and non zero)
  3. Add Http RSR to Non zero SPs over time

See Issue.

Copy link

cloudflare-workers-and-pages bot commented Jan 12, 2025

Deploying spark-dashboard with  Cloudflare Pages  Cloudflare Pages

Latest commit: 41f8c15
Status: ✅  Deploy successful!
Preview URL: https://0a1df9a0.spark-dashboard.pages.dev
Branch Preview URL: https://nhaimerl-add-http-rsr.spark-dashboard.pages.dev

View logs

@@ -60,7 +60,7 @@ const end = view(Inputs.date({label: "End", value: getDateXDaysAgo(1) }));
resize((width) => Histogram(SparkMinerRates, { width, title: "Retrieval Success Rate Buckets", thresholds: 10 }))
}</div>
<div class="card">${
resize((width) => Histogram(nonZeroSparkMinerRates, { width, title: "Non-zero Miners: Retrieval Success Rate Buckets", thresholds: 10 }))
resize((width) => Histogram(nonZeroSparkMinerRates.map((record) => ({success_rate: record.success_rate, success_rate_http: record.success_rate_http? record.success_rate_http: null})), { width, title: "Non-zero Miners: Retrieval Success Rate Buckets", thresholds: 10 }))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We do not want to count success_rate_http of 0 or null for this histogram which is why we set all 0, undefined and null values of success_rate_http to null. The histogram function then filters out all null values as those are not valid for plotting.

Copy link
Contributor

@pyropy pyropy Jan 14, 2025

Choose a reason for hiding this comment

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

We're also filtering for values inside Histogram. Do we need to filter values here too? Also in this case if value is 0 it will be assigned null.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, because the filter inside of Histogram only filters for null values. For this specific chart we also do not want all 0 values, which is why we need to do the filtering before accesing Histogram.

@@ -86,7 +88,7 @@ const percentiles = Object.entries(SparkMinerRsrSummaries)
].map(above => ({
day: new Date(day),
label: `> ${above * 100}%`,
count: countAbove(miners.map(m => m.success_rate), above)
count_succes_rate: countAbove(miners.map(m => m.success_rate), above),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

For naming consistency I also renamed the success rate here.

Nikolas Haimerl added 2 commits January 13, 2025 10:59
})),
...filteredEvents.map((event) => ({
day: event.day,
success_rate_http: Number(event.success_rate_http),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

success_rate_http may be null and for consistency with past data as well as the graph Filecoin SPs with a non-zero Spark Retrieval Success Rate' I set past null values to 0. This way the graphs are consistent in how they handle past data.

@NikolasHaimerl NikolasHaimerl marked this pull request as ready for review January 13, 2025 10:20
@NikolasHaimerl NikolasHaimerl requested review from bajtos and pyropy and removed request for pyropy January 13, 2025 10:20
@bajtos
Copy link
Member

bajtos commented Jan 13, 2025

Great start!

(1)
Is it possible to hide the HTTP line in the chart for days we don't have data for?

Screenshot 2025-01-13 at 14 05 49 Screenshot 2025-01-13 at 14 07 21

(2)
In the miner list at the bottom, please format success_rate_http as percents for consistency with the formatting of success_rate.

Screenshot 2025-01-13 at 14 07 40

(3)
We need to find better names for "Successful" and "HTTP". Most people looking at these charts don't understand the nuances, the names should convey the distinction.

The charts include "Retrieval Success Rate" in the title, I think it's not necessary to repeat that in the legend.

Proposed legend:

  • Successful -> "HTTP or Graphsync"
  • HTTP -> "HTTP only"

@NikolasHaimerl
Copy link
Contributor Author

Great start!

(1) Is it possible to hide the HTTP line in the chart for days we don't have data for?
Screenshot 2025-01-13 at 14 05 49 Screenshot 2025-01-13 at 14 07 21

(2) In the miner list at the bottom, please format success_rate_http as percents for consistency with the formatting of success_rate.
Screenshot 2025-01-13 at 14 07 40

(3) We need to find better names for "Successful" and "HTTP". Most people looking at these charts don't understand the nuances, the names should convey the distinction.

The charts include "Retrieval Success Rate" in the title, I think it's not necessary to repeat that in the legend.

Proposed legend:

* Successful -> "HTTP or Graphsync"

* HTTP -> "HTTP only"

Thanks, I worked in your requested changes.

@bajtos
Copy link
Member

bajtos commented Jan 13, 2025

Thanks, I worked in your requested changes.

Lovely! 😍

The miner table still does not show the HTTP success rate in percent, PTAL again.

Screenshot 2025-01-13 at 16 39 07

On the per-miner page, it looks like we are showing only one line that's initially orange and later switches to blue, can you PTAL?

See e.g. here: https://nhaimerl-add-http-rsr.spark-dashboard.pages.dev/provider/f03028412

Screenshot 2025-01-13 at 16 41 15

@NikolasHaimerl
Copy link
Contributor Author

Thanks, I worked in your requested changes.

Lovely! 😍

The miner table still does not show the HTTP success rate in percent, PTAL again.
Screenshot 2025-01-13 at 16 39 07

On the per-miner page, it looks like we are showing only one line that's initially orange and later switches to blue, can you PTAL?

See e.g. here: https://nhaimerl-add-http-rsr.spark-dashboard.pages.dev/provider/f03028412
Screenshot 2025-01-13 at 16 41 15

I think this is because, the success rates are the same and thus overlay. See: https://30a5bd11.spark-dashboard.pages.dev/provider/f03201941

@bajtos
Copy link
Member

bajtos commented Jan 13, 2025

I think this is because, the success rates are the same and thus overlay.

Makes sense 👍🏻

@NikolasHaimerl
Copy link
Contributor Author

Thanks, I worked in your requested changes.

Lovely! 😍
The miner table still does not show the HTTP success rate in percent, PTAL again.
Screenshot 2025-01-13 at 16 39 07
On the per-miner page, it looks like we are showing only one line that's initially orange and later switches to blue, can you PTAL?
See e.g. here: https://nhaimerl-add-http-rsr.spark-dashboard.pages.dev/provider/f03028412
Screenshot 2025-01-13 at 16 41 15

I think this is because, the success rates are the same and thus overlay. See: https://30a5bd11.spark-dashboard.pages.dev/provider/f03201941

I also worked in the changs for the percentage value of the successful http rate.

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.

LGTM 👏🏻

@NikolasHaimerl NikolasHaimerl merged commit c7a40a1 into main Jan 14, 2025
1 check passed
@NikolasHaimerl NikolasHaimerl deleted the nhaimerl-add-http-rsr branch January 14, 2025 09:17
@bajtos
Copy link
Member

bajtos commented Jan 14, 2025

@juliangruber @pyropy: You may want to review this pull request, too; you are more familiar with this codebase than I am.

@juliangruber juliangruber self-requested a review January 19, 2025 09:51
Copy link
Member

@juliangruber juliangruber left a comment

Choose a reason for hiding this comment

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

the observable parts lgtm, I trust @bajtos's review covered the spark parts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants