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

cli: watch command - print block size #327

Merged
merged 3 commits into from
Aug 3, 2023

Conversation

najeal
Copy link
Contributor

@najeal najeal commented Aug 3, 2023

Closes #300

@najeal najeal requested a review from patrick-ogrady as a code owner August 3, 2023 00:34
@@ -819,6 +825,7 @@ func UnmarshalBlock(raw []byte, parser Parser) (*StatefulBlock, error) {
p.UnpackID(false, &b.StateRoot)
b.UnitsConsumed = p.UnpackUint64(false)
b.WarpResults = set.Bits64(p.UnpackUint64(false))
b.size = len(raw)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we also set size after Marshal? Or, add a comment indicating it is only populated if Unmarshaled?

Copy link
Contributor

Choose a reason for hiding this comment

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

If you add to Marshal, you can get the Len of the packer and can just use that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

cli/chain.go Outdated
utils.Outf(
"{{green}}height:{{/}}%d {{green}}txs:{{/}}%d {{green}}units:{{/}}%d {{green}}root:{{/}}%s {{green}}TPS:{{/}}%.2f {{green}}split:{{/}}%dms\n",
"{{green}}height:{{/}}%d {{green}}txs:{{/}}%d {{green}}units:{{/}}%d {{green}}root:{{/}}%s {{green}}TPS:{{/}}%.2f {{green}}split:{{/}}%dms {{green}}size:{{/}}%.2f\n",
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add KB after the .2f?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@patrick-ogrady patrick-ogrady merged commit d579b26 into ava-labs:main Aug 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[cli] Emit Block Size in KB in watch
2 participants