3

I am trying to measure chain insert rates in a Geth node.

In a deprecated Go-ethereum blog, it says I can use debug.metrics(false) to get all available metrics (so I can use debug.metrics().chain.inserts to get insert rates).

However, that no longer holds. When I tested on the console, even with --metrics flag added in starting a Geth node, the console continues to complain the debug object "has no member 'metrics'".

Here is my output when I type "debug. ", and by the way, it shows a lot more than the options listed here.

Here is my output image when I type "debug. <tab>"

I then went to the codebase, and see metrics objects are still there. I am wondering how can I get some metrics reports as the outputs in the deprecated blog.

Any help is appreciated!

2

In Geth 1.9, there were many changes to how metrics a monitored. For example, the endpoint geth --monitor was completely removed.

To get the metrics from your node:

  1. Run your geth node with the added flags --metrics --pprof
  2. Navigate to http://localhost:6060/debug/metrics

Notice that if you are running geth on a remote system, you will need to adjust he IP address, enable the port on the firewall and adjust port forwarding if applicable.

The resulting web page should show something like this:

{
"chain/account/commits.50-percentile": 0,
"chain/account/commits.75-percentile": 0,
"chain/account/commits.95-percentile": 0,
"chain/account/commits.99-percentile": 0,
"chain/account/commits.999-percentile": 0,
"chain/account/commits.count": 67,
"chain/account/commits.fifteen-minute": 0.045282483590452616,
"chain/account/commits.five-minute": 0.06561088031274115,
"chain/account/commits.max": 0,
.
.
.
}

Reference blogpost https://blog.ethereum.org/2019/07/10/geth-v1-9-0/

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.