Skip to content
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

cli: porcelain #7

Closed
cirocosta opened this issue Apr 25, 2021 · 2 comments
Closed

cli: porcelain #7

cirocosta opened this issue Apr 25, 2021 · 2 comments

Comments

@cirocosta
Copy link
Owner

cirocosta commented Apr 25, 2021

at the moment, all we do is output the json representation of the internal structures that we have in go structs.

given that we already have -v to put under stderr the json as it goes through the wire, let's make the cli pretty 💅

@cirocosta
Copy link
Owner Author

implemented a pretty() for pretty much every command, except those that don't make a lot of sense (like for getting block templates).

e.g.

$ monero daemon rpc-access-tracking
RPC                             COUNT   TIME SPENT SERVING      CREDITS
getblockhash                    1       10.157µs                0
get_height                      1       26.892µs                0
rpc_access_tracking             7       52.88µs                 0
get_last_block_header           2       78.08µs                 2
hard_fork_info                  8       83.389µs                8
get_transaction_pool_stats      8       577.286µs               8
get_connections                 1       671.059µs               0
get_transactions                4       1.143642ms              4
get_info                        1       1.304111ms              1
get_public_nodes                5       15.813432ms             0
get_peer_list                   15      52.716227ms             0
sync_info                       19      54.221358ms             38
get_transaction_pool            6       65.775668ms             116
get_coinbase_tx_sum             1       1m8.209161023s          4804044

@cirocosta
Copy link
Owner Author

ps.: definitely need some better support for displaying the proper units of certain fields, like

$ Bytes Max:                              2734
Bytes Med:                              1457
Bytes Min:                              1452
Bytes Total:                            45201
Fee Total:                              978930000
Histogram 98pct:                        0
Txns in Pool for Longer than 10m:       0
Double Spends:                          0
Failing Transactions:                   0
Not Relayed:                            0
Oldest:                                 4 minutes ago
Txns Total:                             27

BYTES                                   TXNS
2734                                    1
1456                                    1
5390                                    3
4879                                    3
3418                                    2
5834                                    4
12253                                   7
1452                                    1
2907                                    2
4878                                    3

but, I'll improve those as we go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant