[Qt] simple mempool info in debug window #6979

pull jonasschnelli wants to merge 1 commits into bitcoin:master from jonasschnelli:2015/11/qt_mempool_easyinfo changing 5 files +136 −44
  1. jonasschnelli commented at 12:50 PM on November 10, 2015: 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: <img width="853" alt="bildschirmfoto 2015-11-10 um 13 50 05" src="https://cloud.githubusercontent.com/assets/178464/11062770/f7f6ac4e-87b1-11e5-892f-aa51afe86275.png">

  2. laanwj added the label GUI on Nov 10, 2015
  3. in src/qt/forms/debugwindow.ui:None in b8fad40f30 outdated
     352 |         </item>
     353 |         <item row="15" column="0">
     354 | -        <widget class="QLabel" name="labelDebugLogfile">
     355 | +        <widget class="QLabel" name="label_3">
     356 | +         <property name="text">
     357 | +          <string>Current amount of transactions</string>
    


    laanwj commented at 2:04 PM on November 10, 2015:

    Current number of transactions

  4. in src/qt/forms/debugwindow.ui:None in b8fad40f30 outdated
     382 | -        <widget class="QPushButton" name="openDebugLogfileButton">
     383 | -         <property name="toolTip">
     384 | -          <string>Open the Bitcoin Core debug log file from the current data directory. This can take a few seconds for large log files.</string>
     385 | +        <widget class="QLabel" name="label_2">
     386 | +         <property name="text">
     387 | +          <string>Dynamic memory usage</string>
    


    laanwj commented at 2:04 PM on November 10, 2015:

    I'd leave out 'dynamic'

  5. laanwj commented at 2:04 PM on November 10, 2015: member

    Concept ACK

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


    paveljanik commented at 2:07 PM on November 10, 2015:

    amount -> number

  7. paveljanik commented at 2:10 PM on November 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...

  8. jonasschnelli commented at 2:15 PM on November 10, 2015: contributor

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

  9. fanquake commented at 2:19 PM on November 10, 2015: member

    conceptACK

  10. jonasschnelli commented at 2:33 PM on November 10, 2015: contributor

    Nit's addressed with two squashme commits.

  11. fanquake commented at 3:55 PM on November 10, 2015: member

    OS X screenshot that includes the latest changes. memory pool

  12. sipa commented at 3:57 PM on November 10, 2015: member

    Random suggestion: under "Block chain", put a " Database cache siE" entry that is pcoinsTip->GetDynamicUsage()" ?

  13. jonasschnelli commented at 4:02 PM on November 10, 2015: contributor

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

  14. sipa commented at 4:03 PM on November 10, 2015: member

    Fair enough, keep the pull request as-is then.

  15. in src/qt/rpcconsole.cpp:None in 71a1b5a0bd outdated
     530 | +    ui->mempoolNumberTxs->setText(QString::number(numberOfTxs));
     531 | +
     532 | +    if (dynUsage < 1024*1024)
     533 | +        ui->mempoolSize->setText(QString::number(dynUsage/1024.0, 'f', 2) + " KB");
     534 | +    else
     535 | +        ui->mempoolSize->setText(QString::number(dynUsage/1024.0/1024.0, 'f', 2) + " MB");
    


    MarcoFalke commented at 4:15 PM on November 10, 2015:

    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)


    laanwj commented at 4:42 PM on November 10, 2015:

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


    MarcoFalke commented at 4:51 PM on November 10, 2015:

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


    MarcoFalke commented at 4:53 PM on November 10, 2015:

    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)


    laanwj commented at 5:01 PM on November 10, 2015:

    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 commented at 5:04 PM on November 10, 2015:

    Technically, B in SI means bel. B as byte is defined by IEEE 1541 (which also defined b to mean bit).

  16. MarcoFalke commented at 4:15 PM on November 10, 2015: member

    Looks good, Concept ACK.

  17. paveljanik commented at 5:08 PM on November 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'.
    
  18. laanwj referenced this in commit fcb4db8744 on Nov 10, 2015
  19. laanwj referenced this in commit 8259078b0a on Nov 10, 2015
  20. laanwj referenced this in commit cf4deb8fae on Nov 10, 2015
  21. jonasschnelli commented at 7:02 PM on November 10, 2015: contributor

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

  22. jonasschnelli commented at 7:10 PM on November 10, 2015: contributor

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

  23. paveljanik commented at 7:24 PM on November 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.

  24. in src/qt/forms/debugwindow.ui:None in 8432bdc0ea outdated
     373 | +          <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
     374 | +         </property>
     375 | +        </widget>
     376 | +       </item>
     377 | +       <item row="8" column="0">
     378 | +        <widget class="QLabel" name="label_11">
    


    MarcoFalke commented at 8:13 PM on November 10, 2015:

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


    MarcoFalke commented at 8:14 PM on November 10, 2015:

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


    jonasschnelli commented at 8:10 AM on November 11, 2015:

    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.

  25. jonasschnelli force-pushed on Nov 11, 2015
  26. jonasschnelli commented at 8:12 AM on November 11, 2015: contributor

    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.

  27. jonasschnelli force-pushed on Nov 18, 2015
  28. jonasschnelli commented at 9:20 PM on November 18, 2015: contributor

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

  29. jonasschnelli added this to the milestone 0.12.0 on Nov 18, 2015
  30. paveljanik commented at 9:39 PM on November 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?

  31. jonasschnelli commented at 9:42 PM on November 18, 2015: contributor

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

  32. jonasschnelli force-pushed on Nov 18, 2015
  33. jonasschnelli commented at 10:25 PM on November 18, 2015: contributor

    Fixed the size_t to float conversion. I accidentally dropped the 1000.0/1000000.0 in the arithmetic.

  34. paveljanik commented at 8:34 AM on November 19, 2015: contributor

    ACK

  35. paveljanik commented at 8:34 AM on November 19, 2015: contributor

    I was wondering how you get the first screenshot :+1:

  36. jonasschnelli commented at 8:44 AM on November 19, 2015: contributor

    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?

  37. paveljanik commented at 8:47 AM on November 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.

  38. jonasschnelli force-pushed on Nov 19, 2015
  39. in src/qt/clientmodel.cpp:None in 7dc083570b outdated
      88 | @@ -88,6 +89,16 @@ QDateTime ClientModel::getLastBlockDate() const
      89 |      return QDateTime::fromTime_t(Params().GenesisBlock().GetBlockTime()); // Genesis block's time of current network
      90 |  }
      91 |  
      92 | +size_t ClientModel::getMempoolSize() const
    


    MarcoFalke commented at 7:23 PM on November 19, 2015:

    Nit: Isn't this long?


    jonasschnelli commented at 7:45 PM on November 19, 2015:

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

  40. jonasschnelli force-pushed on Nov 19, 2015
  41. MarcoFalke commented at 8:00 PM on November 19, 2015: member

    utACK c197798

  42. jonasschnelli force-pushed on Nov 20, 2015
  43. jonasschnelli force-pushed on Nov 20, 2015
  44. [Qt] simple mempool info in debug window c197798d1b
  45. jonasschnelli force-pushed on Nov 20, 2015
  46. MarcoFalke commented at 1:12 PM on November 20, 2015: member

    Teseted ACK c197798. Code looks clean.

  47. laanwj commented at 1:34 PM on November 20, 2015: member

    Tested ACK

  48. laanwj merged this on Nov 20, 2015
  49. laanwj closed this on Nov 20, 2015

  50. laanwj referenced this in commit 776848acef on Nov 20, 2015
  51. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 18:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me