综合资讯   

beego 0.1.1 版本发布,支持 pprof

时间:2012-12-27 16:40:54

目前beego框架新增了pprof,默认是不开启的,如果你需要测试性能,查看响应的执行goroutine之类的信息,其实Go的默认包"net/http/pprof"已经具有该功能,但是由于beego重新封装了ServHTTP函数,所以如果你默认的包含是无法开启该功能的,所以这一次经过对beego的内部改造支持pprof

你可以通过如下代码开启他:

 

beego.PprofOn = true

然后你就可以在浏览器中开启调试:

除了这些默认的支持外,还支持如下信息

 

/debug/pprof/cmdline
/debug/pprof/profile
/debug/pprof/symbol

 

 

 

来源:开源中国社区 [http://www.oschina.net]

Notice: Constant RUNTIME already defined in /srv/html/srccn/news/config.php on line 15 Notice: Constant ROOTDIR already defined in /srv/html/srccn/news/config.php on line 16 Notice: Constant SITEDIR already defined in /srv/html/srccn/news/config.php on line 17 Notice: Constant DATAURL already defined in /srv/html/srccn/news/config.php on line 20 Notice: Constant VERSION already defined in /srv/html/srccn/news/system/kernel.php on line 17 Notice: Constant COREDIR already defined in /srv/html/srccn/news/system/kernel.php on line 18 Fatal error: require(): Cannot redeclare class mysql in /srv/html/srccn/news/system/kernel.php on line 22