Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
[Qt] Add interactive mempool graph #8550
Conversation
jonasschnelli
added
the
GUI
label
Aug 19, 2016
|
Concept ACK. Will test later. |
|
Added the missing button PNGs now to git. This should fix the compile issue. |
|
Nice. Some people might want to see actual byte-size, weights, etc; probably will overflow the one-line-per-item paradigm quickly - maybe have a dropdown box to add stuff? |
|
Yes. Dropdown box could make sense. Adding a second graph below or on the right that just plots different data would probably also look good. |
MarcoFalke
commented on an outdated diff
Aug 19, 2016
| + QDateTime fromDateTime = toDateTime.addSecs(-timeFilter); //-1h | ||
| + if (timeFilter == 0) | ||
| + { | ||
| + // disable filter if timeFilter == 0 | ||
| + toDateTime.setTime_t(0); | ||
| + fromDateTime.setTime_t(0); | ||
| + } | ||
| + | ||
| + mempoolSamples_t vSamples = clientModel->getMempoolStatsInRange(fromDateTime, toDateTime); | ||
| + | ||
| + // set the values into the overview labels | ||
| + if (vSamples.size()) | ||
| + { | ||
| + dynMemUsageValueItem->setPlainText(GUIUtil::formatBytes(vSamples.back().dynMemUsage)); | ||
| + txCountValueItem->setPlainText(QString::number(vSamples.back().txCount)); | ||
| + minFeeValueItem->setPlainText(QString::number(vSamples.back().minFeePerK)); |
MarcoFalke
Member
|
MarcoFalke
and 2 others
commented on an outdated diff
Aug 20, 2016
| @@ -351,6 +354,11 @@ void BitcoinGUI::createActions() | ||
| // initially disable the debug window menu item | ||
| openRPCConsoleAction->setEnabled(false); | ||
| + showMempoolStatsAction = new QAction(platformStyle->TextColorIcon(":/icons/mempoolstats"), tr("&Mempool Statistics"), this); |
luke-jr
Member
|
|
Switched to "Arial" as font and added a auto-size-adjustment. |
|
Nit: run optimize-pngs and mention the icons in assets_attribution? |
|
Optimized the pngs and added them to the assets attribution file. |
Mendeleyef
commented
Aug 20, 2016
|
Concept ACK. |
|
Nit1: The graph window is always drawn on top of the main window, even when the main window is active. It makes it annoying to use the rest of the GUI while this is open. Nit2: The quantity labels for the Dynamic Memory Usage values on the left hand side of the graph are cramped and cut off some of the characters. See "500.00 KB" in the screenshot. It is like that for larger values once it gets into the 100MBs too. |
|
I'm not sure what I'm doing wrong but I've merged this and the graph is empty, and has been for an hour now... :-s i.e. Dynamic Memory Usage is stuck on 0 bytes, Amount of Txs also 0, MinRelayFee also zero. |
|
@rebroad: what does |
|
@jonasschnelli problem solved - I had blocksonly=1 in the config file!! It's working really nicely now - great job!! I love how it can be resized and the period of time changed without the graph resetting (unlike the network traffic graph!). |
|
Using images for basically-a-checkbox gives a non-native look on every system. It looks like we can just colour a QCheckBox? |
|
Rebase needed. Concept ACK Agree about checkboxes... |
|
Rebased on top of #8501 |
MarcoFalke
and 2 others
commented on an outdated diff
Sep 9, 2016
| @@ -234,6 +237,11 @@ RES_ICONS = \ | ||
| qt/res/icons/bitcoin.ico \ | ||
| qt/res/icons/bitcoin_testnet.ico \ | ||
| qt/res/icons/bitcoin.png \ | ||
| + qt/res/icons/button_off.png \ | ||
| + qt/res/icons/button_on_blue.png \ |
MarcoFalke
Member
|
| @@ -2837,6 +2844,9 @@ bool static ConnectTip(CValidationState& state, const CChainParams& chainparams, | ||
| for(unsigned int i=0; i < pblock->vtx.size(); i++) | ||
| txChanged.push_back(std::make_tuple(pblock->vtx[i], pindexNew, i)); | ||
| + // update mempool stats | ||
| + CStats::DefaultStats()->addMempoolSample(mempool.size(), mempool.DynamicMemoryUsage(), mempool.GetMinFee(GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000).GetFeePerK()); |
paveljanik
Sep 15, 2016
Contributor
Can you please do something with this long line? It is there ~3 times and does a simple thing - worth a better method to add a sample?
jonasschnelli
Sep 15, 2016
Member
I like the current layering concept. IMO its preferable that the stats.cpp module has no knowledge over the txmempool.h's classes, etc., I prefer to keep it as "dump" as possible.
| + QGraphicsTextItem *item = scene->addText(drawTime.toString("HH:mm"), gridFont); | ||
| + item->setPos(GRAPH_PADDING_LEFT+lX-(item->boundingRect().width()/2), bottom); | ||
| + redrawItems.append(item); | ||
| + qint64 step = secsTotal/amountOfLinesV; |
paveljanik
Sep 15, 2016
Contributor
-Wshadow warning:
qt/mempoolstats.cpp:351:16: warning: declaration shadows a local variable [-Wshadow]
qint64 step = secsTotal/amountOfLinesV;
^
qt/mempoolstats.cpp:240:11: note: previous declaration is here
qreal step = maxwidth/(double)vSamples.size();
^
1 warning generated.
| + | ||
| +}; | ||
| + | ||
| +void RegisterStatsRPCCommands(CRPCTable& tableRPC) |
paveljanik
Sep 15, 2016
Contributor
-Wshadow warning:
stats/rpc_stats.cpp:65:42: warning: declaration shadows a variable in the global namespace [-Wshadow]
void RegisterStatsRPCCommands(CRPCTable& tableRPC)
^
./rpc/server.h:172:18: note: previous declaration is here
extern CRPCTable tableRPC;
^
1 warning generated.
|
I really like this! Suggestions:
|
|
Rebase needed. Hmm, github shows "Conflicting files"... |
|
I've been testing this under various window managers. On mwm the title of the mempool window says "bitcoin-qt". Also, it's not its own window like the debug window is, but a child of the main bitcoin-qt window, so it cannot be minimised on its own, and is minimised whenever the main window is minimised. |
|
Thanks @rebroad. |
|
@jonasschnelli Needed a little rebasing... d7857e1 |
|
Concept ACK, looks nice! |
|
ping @jonasschnelli Did you get to overhauling this PR? |
Victorsueca
commented
Nov 13, 2016
•
|
ACK 7a7d631 |
|
Removed the custom checkbox icons. |
| @@ -79,6 +80,7 @@ Comment: Modifications of Stephan Hutchings Typicons | ||
| Files: src/qt/res/icons/about.png | ||
| src/qt/res/icons/bitcoin.* | ||
| + src/qt/res/icons/button_* |
|
@jonasschnelli Please address my comments here: #8550 (comment) |
|
I think the click-the-human-readable-timeframe was better, but I replaced it with a slider to match our bandwidth graph. Probably they should both be the same, whatever we go with (ie, replace the sliders together, in a subsequent PR). |
|
More graph things are cool. But I think this data is basically worthless to users, if someone goes and makes and gives you a zillion minrelayfee transactions that will never get confirmed ... the graph will read maximum, but nothing has really changed for the user or the network. A stacked chart of mempool bytes at different feerates would be much more interesting and useful to users like how sipa's chart displays the utxo set http://bitcoin.sipa.be/utxo_size.png as it would make it possible to tell things that will get confirmed (bottom stacks of the graph) from noise (higher stacks). |
|
@gmaxwell Showing memory utilization, especially in relation to minfeerelay is useful for anyone wanting to refine the algorithm for setting minfeerelay. I have set maxmempool to 144, i.e. 24 hours worth of 1MB blocks - in order to give me an indication of the minimum fee needed to keep a tx in the mempool for at least 24 hours - although not an indication for how much the fee needs to be to get it confirmed within 24 hours, admittedly. |
|
I like the idea of the stacked chart. However I wanted to start with a simple graph to get in the fundamental stuff (stats core classes, drawing stuff). At the moment, the only insight into the mempool from the GUI you can get is the amount of transactions. IMO step after step. |
I tend to agree - one step at a time, scope creep before the initial merge will likely mean that this will never happen at all. |
|
@laanwj spot on re scope creep. In this sense, I'd say ACK to merging it now. The screenshot attached is a typical example of what it looks like after running for a week or so. One thing that becomes apparent is that the horizontal graph label points become useless - i.e. once it goes over 24 hours of duration, it would make sense to switch to date instead of time. |
| @@ -148,6 +148,9 @@ void OptionsModel::Init(bool resetSettings) | ||
| if (!SoftSetArg("-lang", settings.value("language").toString().toStdString())) | ||
| addOverriddenOption("-lang"); | ||
| + // Enable statistics by default | ||
| + SoftSetBoolArg("-statsenable", true); |
added a commit
to bitcoinknots/bitcoin
that referenced
this pull request
Dec 21, 2016
added a commit
to bitcoinknots/bitcoin
that referenced
this pull request
Dec 21, 2016
|
Rebase needed. I really really would like to see this included in the GUI in the next version! |
|
FWIW, rebased (at least part of the way) in my |
|
This is based on #8501 (core change with additional RPC command) which has to get right first. |
|
Concept ACK needs rebase |
MarcoFalke
referenced this pull request
Mar 8, 2017
Closed
Great plan and design a bitcoin wallet #9948
DATSEC
commented
Mar 8, 2017
|
The graphics are good, the design does not forget I like this one
|
jonasschnelli
referenced this pull request
May 16, 2017
Open
Network Traffic/Reset delayed action #10406
|
Seems the discussion here bled out. I'd say please review the code, and then get it merged. Visual details etc can be changed later. Real-time statistics is one reason why people like to run their own nodes. |
|
Needs rebase. |
|
Concept ACK. I can't compile this (log gist). I'll try again after the rebase.
Agreed. It would be nice to have a little chart icon in the bottom right corner of the wallet (in a future PR). That said, I also agree with:
|
jonasschnelli
added some commits
Aug 12, 2016
|
Rebased. |
If it's a lot of work, feel free to leave "nice but not critical" features such as this out when compiling with Qt4. |











jonasschnelli commentedAug 19, 2016
Includes #8501
At the moment, the mempool graph is not very prominently placed (next to the debug window).

Features: