Skip to content

stats tool

zgw edited this page Dec 4, 2018 · 3 revisions

Code

pyquarkchain/quarkchain/tools/stats

Monitor chain height

/code/pyquarkchain/quarkchain/tools#$ pypy3 stats -i 2 --ip localhost
QuarkChain Cluster Stats

CPU:                8
Memory:             16 GB
IP:                 localhost
Shards:             8
Network Id:         22
Peers:              35.231.158.99:38291, 104.248.77.137:38291

Timestamp             Syncing    ROOT SHARDS
2018-12-03 15:43:04     False      64 [425, 426, 470, 437, 440, 447, 387, 371]
2018-12-03 15:43:06     False      64 [425, 426, 470, 437, 440, 447, 387, 371]
2018-12-03 15:43:08     False      64 [425, 426, 470, 437, 440, 447, 387, 371]
2018-12-03 15:43:10     False      64 [426, 426, 470, 437, 440, 447, 387, 371]
2018-12-03 15:43:12     False      64 [427, 426, 470, 437, 441, 448, 387, 371]

Monitor account balance

/code/pyquarkchain/quarkchain/tools# pypy3 stats -i 5 -a 0xb16A444c9A0D68F5E9f60e1004091B9F0cda34A9B10d0E9F --ip localhost
QuarkChain Cluster Stats

CPU:                8
Memory:             16 GB
IP:                 localhost
Shards:             8
Network Id:         22
Peers:              78.1.187.232:38291, 54.187.247.171:38291

Querying balances for 0xb16a444c9a0d68f5e9f60e1004091b9f0cda34a9b10d0e9f
Timestamp                         Total    Shards
2018-12-03 15:51:07                 215    50, 35, 30, 20, 27.5, 42.5, 5, 5
2018-12-03 15:51:12                 215    50, 35, 30, 20, 27.5, 42.5, 5, 5
2018-12-03 15:51:17                 215    50, 35, 30, 20, 27.5, 42.5, 5, 5
2018-12-03 15:51:22                 215    50, 35, 30, 20, 27.5, 42.5, 5, 5
2018-12-03 15:51:27                 215    50, 35, 30, 20, 27.5, 42.5, 5, 5

Help message

/code/pyquarkchain/quarkchain/tools# pypy3 stats --help
usage: stats [-h] [--ip IP] [-v] [-i INTERVAL] [-a ADDRESS]

optional arguments:
  -h, --help            show this help message and exit
  --ip IP               Cluster IP
  -v, --verbose         Show more details
  -i INTERVAL, --interval INTERVAL
                        Query interval in second
  -a ADDRESS, --address ADDRESS
                        Query account balance if a QKC address is provided