Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to request stats for a Vat. #411

Merged
merged 3 commits into from
Jan 23, 2020
Merged

Conversation

Chris-Hibbert
Copy link
Contributor

@Chris-Hibbert Chris-Hibbert commented Jan 13, 2020

Adds collectVatStats and registers it with the device. Returns some basic stats about a vat.

The base change for the vatAdmin changes is here. See this discussion for context.

@Chris-Hibbert Chris-Hibbert force-pushed the createDynamicVats branch 2 times, most recently from 32b77a5 to f7c09eb Compare January 13, 2020 05:21
@Chris-Hibbert Chris-Hibbert requested a review from warner January 13, 2020 06:07
@Chris-Hibbert Chris-Hibbert force-pushed the vatStats branch 2 times, most recently from b159f74 to ea444f3 Compare January 13, 2020 21:56
Copy link
Member

@warner warner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, although the registerVatCreationFunction bit might need to change if you adopt the endowments change I suggested in the earlier PR

@@ -507,6 +507,15 @@ export default function makeKernelKeeper(storage) {
});
}

function vatStats(vatID) {
return harden({
nextObjectId: storage.get(`${vatID}.o.nextID`),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do these want to be Nat(Number(xx)) instead of strings?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea.

@warner warner added the SwingSet package: SwingSet label Jan 21, 2020
@Chris-Hibbert Chris-Hibbert force-pushed the createDynamicVats branch 2 times, most recently from ac545fc to 77820e3 Compare January 23, 2020 01:36
Changes from a previous version:
* Subtract the starting index to give counts
* ask the vat manager rather than the kernelKeeper.

remaining question: is the serialized object containing stats safe, or
should it be turned into text?
@Chris-Hibbert Chris-Hibbert merged commit b669f53 into createDynamicVats Jan 23, 2020
@Chris-Hibbert Chris-Hibbert deleted the vatStats branch March 2, 2020 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
SwingSet package: SwingSet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants