From 85428a62c1448160140aa10f0fba11e74980b3a3 Mon Sep 17 00:00:00 2001 From: Scott Bender Date: Thu, 15 Aug 2024 13:50:39 -0400 Subject: [PATCH 1/2] fix: provider stats write count is incremented to much --- src/deltastats.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/deltastats.ts b/src/deltastats.ts index fc7366d9f..7467f24de 100644 --- a/src/deltastats.ts +++ b/src/deltastats.ts @@ -65,8 +65,9 @@ export function startDeltaStatistics( (app.providerStatistics[msg.providerId] = new ProviderStats()) if (msg.count !== undefined) { stats.writeCount += msg.count + } else { + stats.writeCount++ } - stats.writeCount++ }) return setInterval(() => { From c5f73c82e8692da66a40350f2ee2a5a4fc00c31e Mon Sep 17 00:00:00 2001 From: Scott Bender Date: Thu, 15 Aug 2024 14:38:26 -0400 Subject: [PATCH 2/2] fix: ProviderStats not initialzed propery --- src/deltastats.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/deltastats.ts b/src/deltastats.ts index 7467f24de..d59ede8da 100644 --- a/src/deltastats.ts +++ b/src/deltastats.ts @@ -105,10 +105,7 @@ export function incDeltaStatistics( function updateProviderPeriodStats(app: any) { app.providers.forEach((provider: any) => { if (isUndefined(app.providerStatistics[provider.id])) { - app.providerStatistics[provider.id] = { - deltaCount: 0, - deltaRate: 0 - } + app.providerStatistics[provider.id] = new ProviderStats() } })