-
Notifications
You must be signed in to change notification settings - Fork 1
Add HTTP HEAD results. CheckerNetwork/spark-checker#104 #29
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
Conversation
Deploying spark-dashboard with
|
Latest commit: |
0ddc4b3
|
Status: | ✅ Deploy successful! |
Preview URL: | https://855411ae.spark-dashboard.pages.dev |
Branch Preview URL: | https://add-http-head.spark-dashboard.pages.dev |
successful_http_head
. CheckerNetwork/spark-checker#104
FWIW, the Cloudflare Pages build is failing:
|
I think we need to find a more compact format. The current array of objects with verbose properties introduces too much overhead. Here is what I was thinking about (conceptually): //-- a shared helper --//
const FIELDS = [
'ttfb_ms',
'success_rate',
'total',
// etc.
]
// convert from key:value object to an array of values
function packSparkMinerRates(record) {
return FIELDS.map(f => record[f])
}
// convert from array of values to key:value object
function unpackSparkMinerRates(data) {
return Object.fromEntries(FIELDS.map(f => [f, data[f]]))
}
//-- in data-fetching JS file --//
process.stdout.write(JSON.stringify(summary.map(r => packSparkMinerRates(r)))
//-- in provider/[provider.md] --//
const rsrData = FileAttachment(
`../data/${observable.params.provider}-spark-rsr-summary.json`,
).json().map(r => unpackSparkMinerRates(r)) Alternatively, can we use a more efficient storage format like CSV? https://observablehq.com/documentation/data/files/file-attachments#csv-files (We need to figure out how to convert JSON fetched from spark-stats API into a CSV file.) @juliangruber @NikolasHaimerl @pyropy Thoughts? |
@bajtos I think doing we should do both as that would ship lowest amount of data to the client. I found this library json2csv which seems to have good amount of weekly downloads that offers, as the name suggest, converting JSON to CSV but also it offers filtering (you can specify json fields that get converted to columns). Here's the library docs. |
Closes CheckerNetwork/spark-checker#104
Blocked by CheckerNetwork/spark-stats#322Blocked by #31 (without tooltips, overlapping lines are impossible to read)