标签:情况 指针 href 申请 面积 分析 返回 htm 质量
go test -cover
直接输出覆盖率go test -run TestAll
指定要运行的单元测试函数go test -cover -coverprofile=c.out
go tool cover -html=c.out -o coverage.html
输出具体的代码覆盖情况执行所有函数 go test -bench=".*"
执行指定函数 go test -bench="BenchmarkWithPool"
生成内存和cpu分析文件 go test -bench="BenchmarkWithPool" -cpuprofile cpu.out -memprofile mem.out
分析cpu文件 go tool pprof cpu.out
分析内存文件 go tool pprof mem.out
输出png图 图中红色方块面积越大 证明申请的内存越大或者消耗cpu越多
标签:情况 指针 href 申请 面积 分析 返回 htm 质量
原文地址:https://www.cnblogs.com/alin-qu/p/11179337.html