Turns on block profiling for the given duration and writes profile data to disk. It uses a profile rate of 1 for most accurate information. If a different rate is desired, set the rate and write the profile manually using debug_writeBlockProfile.
Turns on mutex profiling for nsec (nanosecond) and writes profile data to file. It uses a profile rate of 1 for most accurate information. If a different rate is desired, set the rate and write the profile manually.
Returns true if the pprof HTTP server is running and false otherwise.
Client
Method Invocation
Console
debug.isPProfRunning()
RPC
{"method": "debug_isPProfRunning", "params": []}
Parameters
None
Return Value
Type
Description
bool
true if the pprof HTTP server is running and false otherwise.
Example
Console
HTTP RPC
debug_setBlockProfileRate
Sets the rate (in samples/sec) of goroutine block profile data collection. A non-zero rate enables block profiling, setting it to zero stops the profile. Collected profile data can be written using debug_writeBlockProfile.
Writes an allocation profile to the given file. Note that the profiling rate cannot be set through the API, it must be set on the command line using the --memprofilerate flag.
# To start the pprof server at 127.0.0.1:6060
> debug.startPProf()
null
# To start the pprof server at localhost:12345
> debug.startPProf("localhost", 12345)
null
# To start the pprof server at localhost:6060
$ curl -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"debug_startPProf","params":["localhost", 6060],"id":1}' https://public-en-baobab.klaytn.net
{"jsonrpc":"2.0","id":1,"result":null}