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: create cron nft-ttr to measure nft time to retrievability #1945

Merged
merged 99 commits into from
Jun 16, 2022

Conversation

gobengo
Copy link
Contributor

@gobengo gobengo commented May 25, 2022

Motivation:

Plan

  1. note all feedback
    • dont use jest for cron tests. use ava
    • dont use yargs for argv parsing, use "sade": "^1.7.4"
    • use less fields on nft-ttr metric via
    • make nft-ttr retrieval metric a histogram instead of a gauge via
    • alan thoughts
      • It would be nice to be uploading some useful data rather than just junk
      • A typical NFT use case 10k drops
        • Folks typically upload a directory with 10k JSON files and also 10k of images (the files must not be the same or deduplication will occur)
      • We don't have to upload 10MB every time. In the Web3.Storage client we expose the DAG splitting size as a param to put. In NFT.Storage you could use carbites to split the DAG by a smaller size and then call storeCar multiple times.
      • When available (Release v0.13 ipfs/kubo#8640), you might want to use the ?format=car parameter on the gateways to verify ALL the blocks of the DAG are accessible.
  2. updates based on review/blocking feedback
  3. merge this - whatever is required to get approval
  4. prioritized other tasks to do while awaiting review approval
    • update this PR to use sade for arg parsing
    • update this PR such that cron package uses ava for test running (no jest)
    • test retrieving from more than one gateway
  5. verify once merged
    • crons are running by gh actions once the workflow is described in main branch
    • crons result in metrics successfully pushed to pushgateway
  6. followup pr with
    • fixes if the aforementioned verifications fail

Possible Futures

@gobengo gobengo changed the title add .github/workflows/cron-nft-ttr feat: add .github/workflows/cron-nft-ttr May 25, 2022
@gobengo gobengo changed the title feat: add .github/workflows/cron-nft-ttr feat: create cron nft-ttr to measure nft time to retrievability May 25, 2022
@codecov-commenter
Copy link

codecov-commenter commented May 25, 2022

Codecov Report

Merging #1945 (1aea9c1) into main (377b045) will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##              main     #1945   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            5         5           
  Lines         1259      1259           
=========================================
  Hits          1259      1259           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4f88c21...1aea9c1. Read the comment docs.

@gobengo gobengo marked this pull request as ready for review May 26, 2022 23:33
@gobengo gobengo requested a review from alanshaw May 27, 2022 04:51
@gobengo gobengo requested a review from alanshaw June 14, 2022 21:14
@gobengo
Copy link
Contributor Author

gobengo commented Jun 15, 2022

@alanshaw Should I merge this diff that edits unrelated modules to pass new lint rules into this PR? Or do as followup to this one? I'd slightly prefer the latter.
https://github.com/gobengo/nft.storage/pull/1/files

Copy link
Contributor

@alanshaw alanshaw left a comment

Choose a reason for hiding this comment

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

Lets get this merged and do the follow up items.

Note: needs a rebase (cron jobs are now integrated with release please so have to be release in the same way as other packages)

"@types/mocha",
"@types/node",
"@types/webpack-env"
]
Copy link
Contributor

Choose a reason for hiding this comment

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

Why this nohoist change? Unless it causing an issue, can we move to a separate PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was causing an issue I believe. I will verify it's really required now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it wasn't required. :/ ty

export function createRetrievalDurationSecondsMetric(registry) {
/** @type RetrievalDurationSecondsMetric} */
const metric = new Histogram({
name: 'retrieval_duration_seconds',
Copy link
Contributor

Choose a reason for hiding this comment

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

Yes can be follow up

@gobengo gobengo merged commit b8274f4 into nftstorage:main Jun 16, 2022
gobengo added a commit that referenced this pull request Jun 22, 2022
* fix nft-ttr logging and multiple gateways support

* remove byteLength label from RetrievalDurationMetric

* yarn

* yarn

* cron.yml action does npm rebuild sharp before test

* Revert "cron.yml action does npm rebuild sharp before test"

This reverts commit 3d00e0d.

* cron ava disble workerThreads because sharp doesn't play nice with them https://sharp.pixelplumbing.com/install#worker-threads

* cron workflow runs on pull_request to all branches, not just main

* cron: add linearBuckets to retrieval_duration_seconds histogram

* measureNftTimeToRetrievability.js starts retrievals in parallel after store so both start right after upload. previous serial method would lead to too-low metrics for the second gateway
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.

9 participants