Actually, the geth documentation describes pretty well how to use the tool geth monitor.
Essentially, to do so you need to start a geth instance with both the --metrics
flag and the support for the debug
api.
An example for a local ethereum network:
geth \
--rpc \
--rpcport 8545 \
--rpcaddr 127.0.0.1 \
--rpccorsdomain 127.0.0.1 \
--rpcapi "eth,web3,miner,net,admin,personal,debug" \
--metrics \
--bootnodes <your-bootnodes>
So now you can check that it shows correctly the metrics:
geth attach http://127.0.0.1:8545 --exec "debug.metrics(false)"
And in particular for the txpool metrics:
geth attach http://127.0.0.1:8545 --exec "debug.metrics(false).txpool"
Now you can try to follow the documentation to show the real time graphics for the txpool:
geth monitor --attach=http://127.0.0.1:8545 txpool
N.B.
As reported in the question Geth monitor graphics character encoding, you may have some problems with the encoding.