rpc: unsafe_write_heap_profile

This commit is contained in:
Ethan Buchman
2016-03-11 21:45:19 -05:00
parent 79c9a9f03a
commit cb80a7aa42
3 changed files with 29 additions and 7 deletions

View File

@ -27,6 +27,7 @@ var Routes = map[string]*rpc.RPCFunc{
"unsafe_set_config": rpc.NewRPCFunc(UnsafeSetConfigResult, "type,key,value"),
"unsafe_start_cpu_profiler": rpc.NewRPCFunc(UnsafeStartCPUProfilerResult, "filename"),
"unsafe_stop_cpu_profiler": rpc.NewRPCFunc(UnsafeStopCPUProfilerResult, ""),
"unsafe_write_heap_profile": rpc.NewRPCFunc(UnsafeWriteHeapProfileResult, "filename"),
}
func SubscribeResult(wsCtx rpctypes.WSRPCContext, event string) (ctypes.TMResult, error) {
@ -164,3 +165,11 @@ func UnsafeStopCPUProfilerResult() (ctypes.TMResult, error) {
return r, nil
}
}
func UnsafeWriteHeapProfileResult(filename string) (ctypes.TMResult, error) {
if r, err := UnsafeWriteHeapProfile(filename); err != nil {
return nil, err
} else {
return r, nil
}
}