Skip to content

Commit

Permalink
fix(stats): fixes syntax for api prod version (#683)
Browse files Browse the repository at this point in the history
refs #645
  • Loading branch information
stalniy authored Jan 21, 2025
1 parent 8a79bc7 commit e2bc02d
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions apps/api/src/services/db/providerStatusService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,25 @@ export async function getNetworkCapacity() {
const filteredProviders = uniqBy(providers, provider => provider.hostUri);
const stats = filteredProviders.reduce(
(all, provider) => {
stats.activeCPU += provider.lastSuccessfulSnapshot.activeCPU;
stats.pendingCPU += provider.lastSuccessfulSnapshot.pendingCPU;
stats.availableCPU += provider.lastSuccessfulSnapshot.availableCPU;
all.activeCPU += provider.lastSuccessfulSnapshot.activeCPU;
all.pendingCPU += provider.lastSuccessfulSnapshot.pendingCPU;
all.availableCPU += provider.lastSuccessfulSnapshot.availableCPU;

stats.activeGPU += provider.lastSuccessfulSnapshot.activeGPU;
stats.pendingGPU += provider.lastSuccessfulSnapshot.pendingGPU;
stats.availableGPU += provider.lastSuccessfulSnapshot.availableGPU;
all.activeGPU += provider.lastSuccessfulSnapshot.activeGPU;
all.pendingGPU += provider.lastSuccessfulSnapshot.pendingGPU;
all.availableGPU += provider.lastSuccessfulSnapshot.availableGPU;

stats.activeMemory += provider.lastSuccessfulSnapshot.activeMemory;
stats.pendingMemory += provider.lastSuccessfulSnapshot.pendingMemory;
stats.availableMemory += provider.lastSuccessfulSnapshot.availableMemory;
all.activeMemory += provider.lastSuccessfulSnapshot.activeMemory;
all.pendingMemory += provider.lastSuccessfulSnapshot.pendingMemory;
all.availableMemory += provider.lastSuccessfulSnapshot.availableMemory;

stats.activeEphemeralStorage += provider.lastSuccessfulSnapshot.activeEphemeralStorage;
stats.pendingEphemeralStorage += provider.lastSuccessfulSnapshot.pendingEphemeralStorage;
stats.availableEphemeralStorage += provider.lastSuccessfulSnapshot.availableEphemeralStorage;
all.activeEphemeralStorage += provider.lastSuccessfulSnapshot.activeEphemeralStorage;
all.pendingEphemeralStorage += provider.lastSuccessfulSnapshot.pendingEphemeralStorage;
all.availableEphemeralStorage += provider.lastSuccessfulSnapshot.availableEphemeralStorage;

stats.activePersistentStorage += provider.lastSuccessfulSnapshot.activePersistentStorage;
stats.pendingPersistentStorage += provider.lastSuccessfulSnapshot.pendingPersistentStorage;
stats.availablePersistentStorage += provider.lastSuccessfulSnapshot.availablePersistentStorage;
all.activePersistentStorage += provider.lastSuccessfulSnapshot.activePersistentStorage;
all.pendingPersistentStorage += provider.lastSuccessfulSnapshot.pendingPersistentStorage;
all.availablePersistentStorage += provider.lastSuccessfulSnapshot.availablePersistentStorage;

return all;
},
Expand Down

0 comments on commit e2bc02d

Please sign in to comment.