add cu benchmarking#67
Draft
kaze-cow wants to merge 2 commits into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Record the CU usage of unit tests through a wrapper function.
Context
As an added step, the CU only measures the usage of the given program ID (typically, the settlement program). Hopefully this allows us to better understand our programs usage without having to worry about other programs.
The measurement function parses the
logsoutput of the transaction execution; after some research, it seems there really isn't a better way to do this, and in fact there are other libraries that seem reasonably popular that in fact follow this (just not a rust lib...).How to test
Tests were added to verify the correctness of the function with actual testing data. If you would like, you can convert an extra
svm.send_transactioncall anywhere in the integration tests to use the newcommon::send_transaction_meteredfunction and see the actual whole thing in action!Out of Scope
The actual wiring of the tests to use this new function. Will happen in later PR once its confirmed the approach is favorable.
Also it is not yet determined if we should check in the CU measurement JSON file. If we should, it should probably be moved out of
target/