Skip to content

Commit

Permalink
fix: update stat collection to account for promise retirement
Browse files Browse the repository at this point in the history
  • Loading branch information
FUDCo committed May 28, 2020
1 parent 93e5cec commit 3f242dd
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions packages/SwingSet/src/kernel/state/kernelKeeper.js
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,24 @@ export default function makeKernelKeeper(storage) {
}

function deleteKernelPromise(kpid) {
const state = getRequired(`${kpid}.state`);
switch (state) {
case 'unresolved':
decStat('kpUnresolved');
break;
case 'fulfilledToPresence':
decStat('kpFulfilledToPresence');
break;
case 'fulfilledToData':
decStat('kpFulfilledToData');
break;
case 'rejected':
decStat('kpRejected');
break;
default:
throw new Error(`unknown state for ${kpid}: ${state}`);
}
decStat('kernelPromises');
deleteKernelPromiseState(kpid);
storage.delete(`${kpid}.refCount`);
}
Expand Down

0 comments on commit 3f242dd

Please sign in to comment.