@@ -11,7 +11,8 @@ export const fetchRetrievalSuccessRate = async (pgPools, filter) => {
11
11
day::text,
12
12
SUM(total) as total,
13
13
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
15
16
FROM retrieval_stats
16
17
WHERE day >= $1 AND day <= $2 ${ filter . nonZero === 'true' ? 'AND successful > 0' : '' }
17
18
GROUP BY day
@@ -27,7 +28,9 @@ export const fetchRetrievalSuccessRate = async (pgPools, filter) => {
27
28
success_rate : r . total > 0 ? r . successful / r . total : null ,
28
29
successful_http : r . successful_http ?? null ,
29
30
// 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
31
34
} ) )
32
35
return stats
33
36
}
@@ -218,7 +221,8 @@ export const fetchMinersRSRSummary = async (pgPools, filter) => {
218
221
miner_id,
219
222
SUM(total) as total,
220
223
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
222
226
FROM retrieval_stats
223
227
WHERE day >= $1 AND day <= $2
224
228
GROUP BY miner_id
@@ -233,7 +237,9 @@ export const fetchMinersRSRSummary = async (pgPools, filter) => {
233
237
success_rate : r . total > 0 ? r . successful / r . total : null ,
234
238
successful_http : r . successful_http ?? null ,
235
239
// 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
237
243
} ) )
238
244
return stats
239
245
}
@@ -249,7 +255,8 @@ export const fetchDailyMinerRSRSummary = async (pgPools, { from, to }, minerId)
249
255
SELECT
250
256
day::TEXT,
251
257
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
253
260
FROM retrieval_stats
254
261
WHERE miner_id = $1 AND day >= $2 AND day <= $3
255
262
GROUP BY day
@@ -266,7 +273,9 @@ export const fetchDailyMinerRSRSummary = async (pgPools, { from, to }, minerId)
266
273
success_rate : r . total > 0 ? r . successful / r . total : null ,
267
274
successful_http : r . successful_http ?? null ,
268
275
// 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
270
279
} ) )
271
280
return stats
272
281
}
0 commit comments