Skip to content

Conversation

@sipa
Copy link
Member

@sipa sipa commented Feb 10, 2017

Not intended for 0.14, but may be used to compute the new chainTxData constants in releases.

@sipa
Copy link
Member Author

sipa commented Feb 10, 2017

Alternative: don't allow specifying the window size, and include the output in getblockchaininfo.

" \"txrate\": x.xx, (numeric) The average rate of transactions per second in the window.\n"
"}\n"
"\nExamples:\n"
+ HelpExampleCli("gettxratestats", "")
Copy link
Contributor

Choose a reason for hiding this comment

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

getchaintxstats vs gettxratestats

@paveljanik
Copy link
Contributor

I prefer having it separate from getblockchaininfo because it brings more flexibility - ability to query past data etc. On the other hand, adding current txrate and txcount to getblockchaininfo: why not :-)

@laanwj
Copy link
Member

laanwj commented Feb 10, 2017

Concept ACK. Though I wonder if this shouldn't be an external script, if it's only used for computing some statistics before releases.

On the other hand, adding current txrate and txcount to getblockchaininfo: why not :-)

Well we shouldn't add anything that is non-trivial to compute to getblockchaininfo. I think restricting that call to return state information that is up-to-date and used by the client anyway makes sense. Otherwise it becomes slower and slower as more things are added, like what happened to getinfo.
So a separate call is fine with me.

@sipa
Copy link
Member Author

sipa commented Apr 5, 2017

Though I wonder if this shouldn't be an external script, if it's only used for computing some statistics before releases.

I don't think it's unreasonable to have a built-in function to compute the transaction rate.

@jnewbery
Copy link
Contributor

jnewbery commented Apr 5, 2017

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?

@sipa
Copy link
Member Author

sipa commented Apr 6, 2017

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.

Copy link
Contributor

@TheBlueMatt TheBlueMatt left a 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

+ HelpExampleRpc("gettxratestats", "2016")
);

CBlockIndex* pindex;
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: const CBlockIndex

@jtimon
Copy link
Contributor

jtimon commented Apr 24, 2017

utACK 53d4292
Although for plotting things an interface like initialBlockHeight, endBlockHeight feel more natural than the distance and the hash of the block. It seems there's no functionality loss since the block hash cannot be used to select a chain that is not part of the active chain anyway.

@laanwj
Copy link
Member

laanwj commented May 2, 2017

Can be merged if the small nits by @TheBlueMatt and @paveljanik are fixed

@sipa
Copy link
Member Author

sipa commented May 3, 2017

@laanwj Done.

UniValue getchaintxstats(const JSONRPCRequest& request)
{
if (request.fHelp || request.params.size() > 2)
throw runtime_error(
Copy link
Member

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

laanwj added a commit that referenced this pull request May 3, 2017
bd1f138 Add getchaintxstats RPC (Pieter Wuille)

Tree-SHA512: 270785b25e7e2faad4528b5ef591d9dc6266f15236563e3f02dac1f2d9ce3732c4d44903fcccf38549f7921f29d1a93cb0a118b7453ccc5afd79739b51e68f46
@laanwj
Copy link
Member

laanwj commented May 3, 2017

Merged via d4732f3

@laanwj laanwj closed this May 3, 2017
@laanwj laanwj mentioned this pull request May 3, 2017
12 tasks
@jnewbery jnewbery mentioned this pull request Jul 13, 2017
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jun 19, 2019
bd1f138 Add getchaintxstats RPC (Pieter Wuille)

Tree-SHA512: 270785b25e7e2faad4528b5ef591d9dc6266f15236563e3f02dac1f2d9ce3732c4d44903fcccf38549f7921f29d1a93cb0a118b7453ccc5afd79739b51e68f46
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants