-
Notifications
You must be signed in to change notification settings - Fork 407
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
feat: Sample app for query stats feature #710
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also add some basic tests that at a minimum show that the example still compiles? You can draw inspiration from the other examples
rust/query-stats/README.md
Outdated
This is currently only for use from within DFINITY, as the replica shipped with `dfx` as well as nodes on | ||
mainnet do not enable the query stats feature at the moment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is true this should not be in this repo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is currently true, but the canary rollout should start soon.
|
||
## Issuing load | ||
|
||
We now want to generate queries at a certain rate. One way to achieve this is by using `ic-workload-generator`, which is part of the [IC repo](https://github.com/dfinity/ic/tree/master/rs/workload_generator). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there binaries available for downloading somewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No.
The workload generator is not strictly needed for this, but it's probably the easiest tool to get started.
What would you recommend instead? Should I recommend to run dfx
calls in a bash loop instead?
There is a delay until query stats show up in the canister status. Depending on the configuration, this | ||
can reach from multiple minutes to an hour. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does this behave on local? Is it easily testable there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not currently, but as discussed offline, we should probably enable it in the dfx
replica. I will talk to people to come up with a suggestion on how to do that.
@@ -0,0 +1,75 @@ | |||
# Query stats |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Query stats | |
# Query stats | |
This example is about... |
Co-authored-by: Severin Siffert <[email protected]>
Co-authored-by: Severin Siffert <[email protected]>
Dear @Dfinity-skaestle, In order to potentially merge your code in this open-source repository and therefore proceed with your contribution, we need to have your approval on DFINITY's CLA. If you decide to agree with it, please visit this issue and read the instructions there. Once you have signed it, re-trigger the workflow on this PR to see if your code can be merged. — The DFINITY Foundation |
cloned by #769 |
Overview
With query stats, developers gain insights into the use of query calls in their canister.
This has previously been difficult, since no state can be persisted when executing query calls.
This example shows how to use the canister status to gain access to query statistics.
It also shows how to use a timer to periodically query them and calculate rates for query metrics.