Skip to content

[Qt] simple mempool info in debug window#6979

Merged
laanwj merged 1 commit into
bitcoin:masterfrom
jonasschnelli:2015/11/qt_mempool_easyinfo
Nov 20, 2015
Merged

[Qt] simple mempool info in debug window#6979
laanwj merged 1 commit into
bitcoin:masterfrom
jonasschnelli:2015/11/qt_mempool_easyinfo

Conversation

@jonasschnelli

Copy link
Copy Markdown
Contributor

Having the mempool size in the debug window can be useful.
This PR also moves the "open debug log" button to the right side of the debug window.

The stats gets updated over the same TryLock that is used for the bandwidth graph (no additional blocking is required).

It will ~look like this:
bildschirmfoto 2015-11-10 um 13 50 05

@laanwj laanwj added the GUI label Nov 10, 2015
Comment thread src/qt/forms/debugwindow.ui Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Current number of transactions

@laanwj

laanwj commented Nov 10, 2015

Copy link
Copy Markdown
Member

Concept ACK

Comment thread src/qt/rpcconsole.h Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

amount -> number

@paveljanik

Copy link
Copy Markdown
Contributor

Can you please change Mempool in the above screenshot to Memory pool?
Nice. utACK. Will test later.

I'd like to see also the graph of the memory pool - similar to the Network Traffic tab...

@jonasschnelli

Copy link
Copy Markdown
Contributor Author

@paveljanik: thanks for the review. Yes. The mempool chart is also on my list of things i'd like to do (... and that list is already very large).

@fanquake

Copy link
Copy Markdown
Member

conceptACK

@jonasschnelli

Copy link
Copy Markdown
Contributor Author

Nit's addressed with two squashme commits.

@fanquake

Copy link
Copy Markdown
Member

OS X screenshot that includes the latest changes.
memory pool

@sipa

sipa commented Nov 10, 2015 via email

Copy link
Copy Markdown
Member

@jonasschnelli

Copy link
Copy Markdown
Contributor Author

@sipa: good point. But because of the window height (I try not to enlarge), maybe the database cache size fits better in a new "limits" (or "usage") screen/graph. There i could imaging a mempool size/memusage chart as well as the database-cache (chart and current value).

@sipa

sipa commented Nov 10, 2015 via email

Copy link
Copy Markdown
Member

Comment thread src/qt/rpcconsole.cpp Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't like all those MB, MiB inconsistencies. At least make it consistent with the parameter which sets the mempool size. (Which is not MiB iirc)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We should be using MB (1e6 bytes) unless there is a convincing reason to use MiB (2^20 bytes).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Some people refer to 2^20 bytes as "MB", so at least MiB is clear what it does.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

But it's used less commonly, so MB is fine as well. Just be consistent, which is what the NIT is complaining about. You can't parse the command line in MB (1e6) and then display MB (10^20)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

In bitcoin core we stick to SI units and use MB, which is defined as 1000000, not 1024*1024, MiB, etc if we do that that's a mistake.

@sipa sipa Nov 10, 2015 via email

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@maflcko

maflcko commented Nov 10, 2015

Copy link
Copy Markdown
Member

Looks good, Concept ACK.

@paveljanik

Copy link
Copy Markdown
Contributor

Compile log compared to the master:

+qt/forms/debugwindow.ui: Warning: The name 'label_10' (QLabel) is already in use, defaulting to 'label_101'.
+qt/forms/debugwindow.ui: Warning: The name 'label_3' (QLabel) is already in use, defaulting to 'label_31'.
+qt/forms/debugwindow.ui: Warning: The name 'label_11' (QLabel) is already in use, defaulting to 'label_111'.
+qt/forms/debugwindow.ui: Warning: The name 'label_2' (QLabel) is already in use, defaulting to 'label_21'.
+qt/forms/debugwindow.ui: Warning: The name 'verticalLayout_4' (QVBoxLayout) is already in use, defaulting to 'verticalLayout_41'.
+qt/forms/debugwindow.ui: Warning: The name 'label_21' (QLabel) is already in use, defaulting to 'label_211'.

laanwj added a commit to laanwj/bitcoin that referenced this pull request Nov 10, 2015
Mention use of SI units and prefixes.

This has always been the case, but make it explicit after discussion in bitcoin#6979.
@jonasschnelli

Copy link
Copy Markdown
Contributor Author

@paveljanik: these warning are well known and they are unrelated to this PR. Have also plans to fix the qt id/name conflicts (warnings) soon.

@jonasschnelli

Copy link
Copy Markdown
Contributor Author

Switched to MB / SI units (1000^2 for MB).

@paveljanik

Copy link
Copy Markdown
Contributor

@jonasschnelli I compared the log of the master with the log of the master with this PR. I do not see such warnings in the master builds... I have not investigated from where they come though.

Comment thread src/qt/forms/debugwindow.ui Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As pointed out by @paveljanik label_11 seems already in use: C.f. $ grep -r 'label_11' src/qt/

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Generally speaking: Is it encouraged to use (name)_i++ for references? I'd prefer something like label_memp_whatever.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Right. Agree with that. It was already named label_11 before this PR. The diff looks a bit strange. But i have fixed this now.

@jonasschnelli
jonasschnelli force-pushed the 2015/11/qt_mempool_easyinfo branch from 9824fb0 to 3573481 Compare November 11, 2015 08:09
@jonasschnelli

Copy link
Copy Markdown
Contributor Author

Right. There where QT name/id conflicts (some introduced over this PR), although, Qt auto-increments conflicting IDs and because we don't access them through the code, it wouldn't be a problem.
But it's ugly, agreed.

Added a squashme-commit with a fix.

@jonasschnelli

Copy link
Copy Markdown
Contributor Author

Here are the binaries if someone likes to test this: https://bitcoin.jonasschnelli.ch/pulls/6979/

@jonasschnelli jonasschnelli added this to the 0.12.0 milestone Nov 18, 2015
@paveljanik

Copy link
Copy Markdown
Contributor

Memory usage is continuously updated here, but always ends with .00 KB (on testnet). I have never seen any decimal number there. Do we need these two decimal zeroes?

@jonasschnelli

Copy link
Copy Markdown
Contributor Author

@paveljanik: if the memory usage is grater than 1000000 bytes it will use "MB" and there the precision of two decimal places make sense IMO.

@jonasschnelli
jonasschnelli force-pushed the 2015/11/qt_mempool_easyinfo branch from 67b1393 to 96a0007 Compare November 18, 2015 22:23
@jonasschnelli

Copy link
Copy Markdown
Contributor Author

Fixed the size_t to float conversion. I accidentally dropped the 1000**.0**/1000000**.0** in the arithmetic.

@paveljanik

Copy link
Copy Markdown
Contributor

ACK

@paveljanik

Copy link
Copy Markdown
Contributor

I was wondering how you get the first screenshot 👍

@jonasschnelli

Copy link
Copy Markdown
Contributor Author

I was wondering how you get the first screenshot

I think somewhere the .0 was lost during implementation of the KB/MB switch logic (and the screenshots was done before that). But this does not explain @fanquake 's screen. ?! Maybe on osx QString::number() does somehow evaluate the division always as float?

@paveljanik

Copy link
Copy Markdown
Contributor

I do not think so (division is evaluated first). Maybe his screenshot is from the same code from which you did the screenshot.

@jonasschnelli
jonasschnelli force-pushed the 2015/11/qt_mempool_easyinfo branch from 96a0007 to 7dc0835 Compare November 19, 2015 15:04
Comment thread src/qt/clientmodel.cpp Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit: Isn't this long?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks! Right, .. the map's size() itself is size_t, but the CTxMempool uses long size() in its interface.
Fixed.

@jonasschnelli
jonasschnelli force-pushed the 2015/11/qt_mempool_easyinfo branch from 7dc0835 to 70a6ed8 Compare November 19, 2015 19:44
@maflcko

maflcko commented Nov 19, 2015

Copy link
Copy Markdown
Member

utACK c197798

@jonasschnelli
jonasschnelli force-pushed the 2015/11/qt_mempool_easyinfo branch 2 times, most recently from 0243ab8 to 88865f1 Compare November 20, 2015 07:30
@jonasschnelli
jonasschnelli force-pushed the 2015/11/qt_mempool_easyinfo branch from 88865f1 to c197798 Compare November 20, 2015 07:40
@maflcko

maflcko commented Nov 20, 2015

Copy link
Copy Markdown
Member

Teseted ACK c197798. Code looks clean.

@laanwj

laanwj commented Nov 20, 2015

Copy link
Copy Markdown
Member

Tested ACK

@laanwj
laanwj merged commit c197798 into bitcoin:master Nov 20, 2015
laanwj added a commit that referenced this pull request Nov 20, 2015
c197798 [Qt] simple mempool info in debug window (Jonas Schnelli)
@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.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants