Stats better fieldname

This commit is contained in:
Wietse Wind
2023-10-07 02:06:18 +02:00
parent e27eac276e
commit c79ef979c0

View File

@@ -12,7 +12,7 @@ import { lastLedger } from '../lib/onLedger.mjs'
import { txCount } from '../lib/onTransaction.mjs' import { txCount } from '../lib/onTransaction.mjs'
const startDate = new Date() const startDate = new Date()
let lastServedTxLedger let lastWsPushedLedger
let wss // WebSocket Server let wss // WebSocket Server
@@ -60,7 +60,7 @@ if (!wss) {
}, },
stats: { stats: {
lastLedger: lastLedger ?? null, lastLedger: lastLedger ?? null,
lastServedTxLedger: lastServedTxLedger ?? null, lastWsPushedLedger: lastWsPushedLedger ?? null,
txCount: txCount ?? null, txCount: txCount ?? null,
}, },
}) })
@@ -76,7 +76,7 @@ if (!wss) {
res.json({ res.json({
uptime: new Date() - startDate, uptime: new Date() - startDate,
lastLedger: lastLedger ?? null, lastLedger: lastLedger ?? null,
lastServedTxLedger: lastServedTxLedger ?? null, lastWsPushedLedger: lastWsPushedLedger ?? null,
txCount: txCount ?? null, txCount: txCount ?? null,
}) })
}) })
@@ -141,7 +141,7 @@ const emit = _data => {
data.xpop.blob = undefined data.xpop.blob = undefined
} }
lastServedTxLedger = data.origin.ledgerIndex lastWsPushedLedger = data.origin.ledgerIndex
if (account === '' || data.account === account) { if (account === '' || data.account === account) {
client.send(JSON.stringify(data), { binary: false }) client.send(JSON.stringify(data), { binary: false })