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

[Qt] simple mempool info in debug window #6979

Merged
merged 1 commit into from Nov 20, 2015

Conversation

Projects
None yet
6 participants
@jonasschnelli
Member

jonasschnelli commented Nov 10, 2015

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

@laanwj

View changes

Show outdated Hide outdated src/qt/forms/debugwindow.ui
<widget class="QLabel" name="labelDebugLogfile">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Current amount of transactions</string>

This comment has been minimized.

@laanwj

laanwj Nov 10, 2015

Member

Current number of transactions

@laanwj

laanwj Nov 10, 2015

Member

Current number of transactions

@laanwj

View changes

Show outdated Hide outdated src/qt/forms/debugwindow.ui
<string>Open the Bitcoin Core debug log file from the current data directory. This can take a few seconds for large log files.</string>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Dynamic memory usage</string>

This comment has been minimized.

@laanwj

laanwj Nov 10, 2015

Member

I'd leave out 'dynamic'

@laanwj

laanwj Nov 10, 2015

Member

I'd leave out 'dynamic'

@laanwj

This comment has been minimized.

Show comment
Hide comment
@laanwj

laanwj Nov 10, 2015

Member

Concept ACK

Member

laanwj commented Nov 10, 2015

Concept ACK

@paveljanik

View changes

Show outdated Hide outdated src/qt/rpcconsole.h
@@ -77,6 +77,8 @@ public Q_SLOTS:
void setNumConnections(int count);
/** Set number of blocks and last block date shown in the UI */
void setNumBlocks(int count, const QDateTime& blockDate);
/** Set size (amount of transactions and memory usage) of the mempool in the UI */

This comment has been minimized.

@paveljanik

paveljanik Nov 10, 2015

Contributor

amount -> number

@paveljanik

paveljanik Nov 10, 2015

Contributor

amount -> number

@paveljanik

This comment has been minimized.

Show comment
Hide comment
@paveljanik

paveljanik Nov 10, 2015

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...

Contributor

paveljanik commented Nov 10, 2015

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

This comment has been minimized.

Show comment
Hide comment
@jonasschnelli

jonasschnelli Nov 10, 2015

Member

@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).

Member

jonasschnelli commented Nov 10, 2015

@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

This comment has been minimized.

Show comment
Hide comment
@fanquake

fanquake Nov 10, 2015

Member

conceptACK

Member

fanquake commented Nov 10, 2015

conceptACK

@jonasschnelli

This comment has been minimized.

Show comment
Hide comment
@jonasschnelli

jonasschnelli Nov 10, 2015

Member

Nit's addressed with two squashme commits.

Member

jonasschnelli commented Nov 10, 2015

Nit's addressed with two squashme commits.

@fanquake

This comment has been minimized.

Show comment
Hide comment
@fanquake

fanquake Nov 10, 2015

Member

OS X screenshot that includes the latest changes.
memory pool

Member

fanquake commented Nov 10, 2015

OS X screenshot that includes the latest changes.
memory pool

@sipa

This comment has been minimized.

Show comment
Hide comment
@sipa

sipa Nov 10, 2015

Member
Member

sipa commented Nov 10, 2015

@jonasschnelli

This comment has been minimized.

Show comment
Hide comment
@jonasschnelli

jonasschnelli Nov 10, 2015

Member

@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).

Member

jonasschnelli commented Nov 10, 2015

@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

This comment has been minimized.

Show comment
Hide comment
@sipa

sipa Nov 10, 2015

Member
Member

sipa commented Nov 10, 2015

@MarcoFalke

View changes

Show outdated Hide outdated src/qt/rpcconsole.cpp
if (dynUsage < 1024*1024)
ui->mempoolSize->setText(QString::number(dynUsage/1024.0, 'f', 2) + " KB");
else
ui->mempoolSize->setText(QString::number(dynUsage/1024.0/1024.0, 'f', 2) + " MB");

This comment has been minimized.

@MarcoFalke

MarcoFalke Nov 10, 2015

Member

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)

@MarcoFalke

MarcoFalke Nov 10, 2015

Member

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)

This comment has been minimized.

@laanwj

laanwj Nov 10, 2015

Member

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

@laanwj

laanwj Nov 10, 2015

Member

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

This comment has been minimized.

@MarcoFalke

MarcoFalke Nov 10, 2015

Member

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

@MarcoFalke

MarcoFalke Nov 10, 2015

Member

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

This comment has been minimized.

@MarcoFalke

MarcoFalke Nov 10, 2015

Member

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)

@MarcoFalke

MarcoFalke Nov 10, 2015

Member

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)

This comment has been minimized.

@laanwj

laanwj Nov 10, 2015

Member

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.

@laanwj

laanwj Nov 10, 2015

Member

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.

This comment has been minimized.

@sipa

sipa Nov 10, 2015

Member
@sipa

sipa via email Nov 10, 2015

Member
@MarcoFalke

This comment has been minimized.

Show comment
Hide comment
@MarcoFalke

MarcoFalke Nov 10, 2015

Member

Looks good, Concept ACK.

Member

MarcoFalke commented Nov 10, 2015

Looks good, Concept ACK.

@paveljanik

This comment has been minimized.

Show comment
Hide comment
@paveljanik

paveljanik Nov 10, 2015

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'.
Contributor

paveljanik commented Nov 10, 2015

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

doc: Add note about SI units to developer notes
Mention use of SI units and prefixes.

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

This comment has been minimized.

Show comment
Hide comment
@jonasschnelli

jonasschnelli Nov 10, 2015

Member

@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.

Member

jonasschnelli commented Nov 10, 2015

@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

This comment has been minimized.

Show comment
Hide comment
@jonasschnelli

jonasschnelli Nov 10, 2015

Member

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

Member

jonasschnelli commented Nov 10, 2015

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

@paveljanik

This comment has been minimized.

Show comment
Hide comment
@paveljanik

paveljanik Nov 10, 2015

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.

Contributor

paveljanik commented Nov 10, 2015

@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.

@MarcoFalke

View changes

Show outdated Hide outdated src/qt/forms/debugwindow.ui
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="label_11">

This comment has been minimized.

@MarcoFalke

MarcoFalke Nov 10, 2015

Member

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

@MarcoFalke

MarcoFalke Nov 10, 2015

Member

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

This comment has been minimized.

@MarcoFalke

MarcoFalke Nov 10, 2015

Member

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

@MarcoFalke

MarcoFalke Nov 10, 2015

Member

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

This comment has been minimized.

@jonasschnelli

jonasschnelli Nov 11, 2015

Member

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 Nov 11, 2015

Member

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

This comment has been minimized.

Show comment
Hide comment
@jonasschnelli

jonasschnelli Nov 11, 2015

Member

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.

Member

jonasschnelli commented Nov 11, 2015

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

This comment has been minimized.

Show comment
Hide comment
@jonasschnelli

jonasschnelli Nov 18, 2015

Member

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

Member

jonasschnelli commented Nov 18, 2015

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

This comment has been minimized.

Show comment
Hide comment
@paveljanik

paveljanik Nov 18, 2015

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?

Contributor

paveljanik commented Nov 18, 2015

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

This comment has been minimized.

Show comment
Hide comment
@jonasschnelli

jonasschnelli Nov 18, 2015

Member

@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.

Member

jonasschnelli commented Nov 18, 2015

@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

This comment has been minimized.

Show comment
Hide comment
@jonasschnelli

jonasschnelli Nov 18, 2015

Member

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

Member

jonasschnelli commented Nov 18, 2015

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

@paveljanik

This comment has been minimized.

Show comment
Hide comment
@paveljanik

paveljanik Nov 19, 2015

Contributor

ACK

Contributor

paveljanik commented Nov 19, 2015

ACK

@paveljanik

This comment has been minimized.

Show comment
Hide comment
@paveljanik

paveljanik Nov 19, 2015

Contributor

I was wondering how you get the first screenshot 👍

Contributor

paveljanik commented Nov 19, 2015

I was wondering how you get the first screenshot 👍

@jonasschnelli

This comment has been minimized.

Show comment
Hide comment
@jonasschnelli

jonasschnelli Nov 19, 2015

Member

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?

Member

jonasschnelli commented Nov 19, 2015

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

This comment has been minimized.

Show comment
Hide comment
@paveljanik

paveljanik Nov 19, 2015

Contributor

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

Contributor

paveljanik commented Nov 19, 2015

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

@MarcoFalke

View changes

Show outdated Hide outdated src/qt/clientmodel.cpp
@@ -88,6 +89,16 @@ QDateTime ClientModel::getLastBlockDate() const
return QDateTime::fromTime_t(Params().GenesisBlock().GetBlockTime()); // Genesis block's time of current network
}
size_t ClientModel::getMempoolSize() const

This comment has been minimized.

@MarcoFalke

MarcoFalke Nov 19, 2015

Member

Nit: Isn't this long?

@MarcoFalke

MarcoFalke Nov 19, 2015

Member

Nit: Isn't this long?

This comment has been minimized.

@jonasschnelli

jonasschnelli Nov 19, 2015

Member

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

@jonasschnelli

jonasschnelli Nov 19, 2015

Member

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

@MarcoFalke

This comment has been minimized.

Show comment
Hide comment
@MarcoFalke
Member

MarcoFalke commented Nov 19, 2015

utACK c197798

@MarcoFalke

This comment has been minimized.

Show comment
Hide comment
@MarcoFalke

MarcoFalke Nov 20, 2015

Member

Teseted ACK c197798. Code looks clean.

Member

MarcoFalke commented Nov 20, 2015

Teseted ACK c197798. Code looks clean.

@laanwj

This comment has been minimized.

Show comment
Hide comment
@laanwj

laanwj Nov 20, 2015

Member

Tested ACK

Member

laanwj commented Nov 20, 2015

Tested ACK

@laanwj laanwj merged commit c197798 into bitcoin:master Nov 20, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

laanwj added a commit that referenced this pull request Nov 20, 2015

Merge pull request #6979
c197798 [Qt] simple mempool info in debug window (Jonas Schnelli)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment