-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Add getchaintxstats RPC #9733
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 getchaintxstats RPC #9733
Conversation
|
Alternative: don't allow specifying the window size, and include the output in |
src/rpc/blockchain.cpp
Outdated
| " \"txrate\": x.xx, (numeric) The average rate of transactions per second in the window.\n" | ||
| "}\n" | ||
| "\nExamples:\n" | ||
| + HelpExampleCli("gettxratestats", "") |
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.
getchaintxstats vs gettxratestats
|
I prefer having it separate from |
|
Concept ACK. Though I wonder if this shouldn't be an external script, if it's only used for computing some statistics before releases.
Well we shouldn't add anything that is non-trivial to compute to |
I don't think it's unreasonable to have a built-in function to compute the transaction rate. |
What's the use case for this, other than computing the chainTxData constants? |
Not really a use case, except that's it's generally useful information that someone may be interested in. |
TheBlueMatt
left a comment
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.
utACK +/- the two nits
src/rpc/blockchain.cpp
Outdated
| + HelpExampleRpc("gettxratestats", "2016") | ||
| ); | ||
|
|
||
| CBlockIndex* pindex; |
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.
nit: const CBlockIndex
|
utACK 53d4292 |
|
Can be merged if the small nits by @TheBlueMatt and @paveljanik are fixed |
|
@laanwj Done. |
| UniValue getchaintxstats(const JSONRPCRequest& request) | ||
| { | ||
| if (request.fHelp || request.params.size() > 2) | ||
| throw runtime_error( |
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.
looks like travis complains now: the using namespace was removed, so this should be std::runtime_error, will fix this up before merging
bd1f138 Add getchaintxstats RPC (Pieter Wuille) Tree-SHA512: 270785b25e7e2faad4528b5ef591d9dc6266f15236563e3f02dac1f2d9ce3732c4d44903fcccf38549f7921f29d1a93cb0a118b7453ccc5afd79739b51e68f46
|
Merged via d4732f3 |
bd1f138 Add getchaintxstats RPC (Pieter Wuille) Tree-SHA512: 270785b25e7e2faad4528b5ef591d9dc6266f15236563e3f02dac1f2d9ce3732c4d44903fcccf38549f7921f29d1a93cb0a118b7453ccc5afd79739b51e68f46
Not intended for 0.14, but may be used to compute the new chainTxData constants in releases.