Skip to content

Commit 34cb438

Browse files
juliangruberpyropy
andauthored
Add successful_http_head. CheckerNetwork/spark-checker#104 (#322)
* Add `successful_http_head`. CheckerNetwork/spark-checker#104 * update spark-evaluate --------- Co-authored-by: Srdjan <[email protected]>
1 parent ecb2187 commit 34cb438

File tree

6 files changed

+76
-66
lines changed

6 files changed

+76
-66
lines changed

db/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"standard": "^17.1.2"
1313
},
1414
"dependencies": {
15-
"@filecoin-station/spark-evaluate": "^1.0.4",
15+
"@filecoin-station/spark-evaluate": "^1.2.0",
1616
"pg": "^8.13.3",
1717
"postgrator": "^8.0.0"
1818
},

observer/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"test": "mocha"
1111
},
1212
"devDependencies": {
13-
"@filecoin-station/spark-evaluate": "^1.0.4",
13+
"@filecoin-station/spark-evaluate": "^1.2.0",
1414
"mocha": "^11.1.0",
1515
"standard": "^17.1.2"
1616
},

package-lock.json

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

stats/lib/stats-fetchers.js

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ export const fetchRetrievalSuccessRate = async (pgPools, filter) => {
1111
day::text,
1212
SUM(total) as total,
1313
SUM(successful) as successful,
14-
SUM(successful_http) as successful_http
14+
SUM(successful_http) as successful_http,
15+
SUM(successful_http_head) as successful_http_head
1516
FROM retrieval_stats
1617
WHERE day >= $1 AND day <= $2 ${filter.nonZero === 'true' ? 'AND successful > 0' : ''}
1718
GROUP BY day
@@ -27,7 +28,9 @@ export const fetchRetrievalSuccessRate = async (pgPools, filter) => {
2728
success_rate: r.total > 0 ? r.successful / r.total : null,
2829
successful_http: r.successful_http ?? null,
2930
// successful_http might be null because the column was added later
30-
success_rate_http: r.total > 0 && r.successful_http !== null ? r.successful_http / r.total : null
31+
success_rate_http: r.total > 0 && r.successful_http !== null ? r.successful_http / r.total : null,
32+
// successful_http_head might be null because the column was added later
33+
success_rate_http_head: r.total > 0 && r.successful_http_head !== null ? r.successful_http_head / r.total : null
3134
}))
3235
return stats
3336
}
@@ -218,7 +221,8 @@ export const fetchMinersRSRSummary = async (pgPools, filter) => {
218221
miner_id,
219222
SUM(total) as total,
220223
SUM(successful) as successful,
221-
SUM(successful_http) as successful_http
224+
SUM(successful_http) as successful_http,
225+
SUM(successful_http_head) as successful_http_head
222226
FROM retrieval_stats
223227
WHERE day >= $1 AND day <= $2
224228
GROUP BY miner_id
@@ -233,7 +237,9 @@ export const fetchMinersRSRSummary = async (pgPools, filter) => {
233237
success_rate: r.total > 0 ? r.successful / r.total : null,
234238
successful_http: r.successful_http ?? null,
235239
// successful_http might be null because the column was added later
236-
success_rate_http: r.total > 0 && r.successful_http !== null ? r.successful_http / r.total : null
240+
success_rate_http: r.total > 0 && r.successful_http !== null ? r.successful_http / r.total : null,
241+
// successful_http_head might be null because the column was added later
242+
success_rate_http_head: r.total > 0 && r.successful_http_head !== null ? r.successful_http_head / r.total : null
237243
}))
238244
return stats
239245
}
@@ -249,7 +255,8 @@ export const fetchDailyMinerRSRSummary = async (pgPools, { from, to }, minerId)
249255
SELECT
250256
day::TEXT,
251257
SUM(total) as total, SUM(successful) as successful,
252-
SUM(successful_http) as successful_http
258+
SUM(successful_http) as successful_http,
259+
SUM(successful_http_head) as successful_http_head
253260
FROM retrieval_stats
254261
WHERE miner_id = $1 AND day >= $2 AND day <= $3
255262
GROUP BY day
@@ -266,7 +273,9 @@ export const fetchDailyMinerRSRSummary = async (pgPools, { from, to }, minerId)
266273
success_rate: r.total > 0 ? r.successful / r.total : null,
267274
successful_http: r.successful_http ?? null,
268275
// successful_http might be null because the column was added later
269-
success_rate_http: r.total > 0 && r.successful_http !== null ? r.successful_http / r.total : null
276+
success_rate_http: r.total > 0 && r.successful_http !== null ? r.successful_http / r.total : null,
277+
// successful_http_head might be null because the column was added later
278+
success_rate_http_head: r.total > 0 && r.successful_http_head !== null ? r.successful_http_head / r.total : null
270279
}))
271280
return stats
272281
}

stats/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"test": "mocha"
1010
},
1111
"devDependencies": {
12-
"@filecoin-station/spark-evaluate": "^1.1.0",
12+
"@filecoin-station/spark-evaluate": "^1.2.0",
1313
"mocha": "^11.1.0",
1414
"standard": "^17.1.2"
1515
},

0 commit comments

Comments
 (0)