pprofStack

package
v1.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 25, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

README

安装graphviz

只是为了便捷查看,没有也不影响
brew install graphviz

根据信号对程序进行 性能采样

接收信号量31 
    开始采样:kill -31 pid
    结束采样:kill -31 pid

获取到三个文件:cpu.pprof mem.pprof runtime.trace

开始分析:
    方式一:
        go tool pprof cpu.pprof  // go tool pprof memory.pprof
        top5 指令可查看cpu占用最多的5个指令
        web 指令会调用graphviz生成svg图片并自动打开

        go tool trace runtime.trace

    方式二:
        go tool pprof -http localhost:3000 cpu.pprof
        go tool pprof -http localhost:3000 memory.pprof

根据信号对程序进行 打印堆栈信息

接收信号量32
    开始采样:kill -32 pid
    结束采样:kill -32 pid

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Pprof

func Pprof()

Pprof 分析采样

func Stack

func Stack()

Stack 打印堆栈信息

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL