|
|
@ -11,16 +11,19 @@ export const statsIndexer = () => { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const runLoop = async () => { |
|
|
|
const runLoop = async () => { |
|
|
|
|
|
|
|
l.info('Daily metrics update started...') |
|
|
|
try { |
|
|
|
try { |
|
|
|
const dateStart = Date.now() |
|
|
|
const dateStart = Date.now() |
|
|
|
const limit = 14 |
|
|
|
const daysCount = 14 |
|
|
|
await Promise.all([ |
|
|
|
const metricsStore = stores[0].metrics |
|
|
|
stores[0].metrics.updateWalletsCount(limit), |
|
|
|
|
|
|
|
stores[0].metrics.updateTransactionsCount(limit), |
|
|
|
await metricsStore.updateWalletsCount(daysCount) |
|
|
|
stores[0].metrics.updateAverageFee(limit), |
|
|
|
await metricsStore.updateTransactionsCount(daysCount) |
|
|
|
stores[0].metrics.updateBlockSize(limit), |
|
|
|
await metricsStore.updateAverageFee(daysCount) |
|
|
|
]) |
|
|
|
await metricsStore.updateBlockSize(daysCount) |
|
|
|
|
|
|
|
await metricsStore.updateTotalFee(daysCount) |
|
|
|
await updateTopDailyMetrics() |
|
|
|
await updateTopDailyMetrics() |
|
|
|
|
|
|
|
|
|
|
|
l.info(`Daily metrics updated in ${Math.round((Date.now() - dateStart) / 1000)}s`) |
|
|
|
l.info(`Daily metrics updated in ${Math.round((Date.now() - dateStart) / 1000)}s`) |
|
|
|
} catch (e) { |
|
|
|
} catch (e) { |
|
|
|
l.error('Error on metrics update:', e.message) |
|
|
|
l.error('Error on metrics update:', e.message) |
|
|
|