<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                # package pprof `import "net/http/pprof"` pprof包通過它的HTTP服務端提供pprof可視化工具期望格式的運行時剖面文件數據服務。關于pprof的更多信息,參見[http://code.google.com/p/google-perftools/](http://code.google.com/p/google-perftools/)。 本包一般只需導入獲取其注冊HTTP處理器的副作用。處理器的路徑以/debug/pprof/開始。 要使用pprof,在你的程序里導入本包: ``` import _ "net/http/pprof" ``` 如果你的應用還沒有運行http服務器,你需要開始一個http服務器。添加"net/http"包和"log"包到你的導入列表,然后在main函數開始處添加如下代碼: ``` go func() { log.Println(http.ListenAndServe("localhost:6060", nil)) }() ``` 然后使用pprof工具查看堆剖面: ``` go tool pprof http://localhost:6060/debug/pprof/heap ``` 或查看周期30秒的CPU剖面: ``` go tool pprof http://localhost:6060/debug/pprof/profile ``` 或查看go程阻塞剖面: ``` go tool pprof http://localhost:6060/debug/pprof/block ``` 要查看所有可用的剖面,在你的瀏覽器閱讀[http://localhost:6060/debug/pprof/](http://localhost:6060/debug/pprof/)。要學習這些運轉的設施,訪問: ``` http://blog.golang.org/2011/06/profiling-go-programs.html ``` ## Index * [func Handler(name string) http.Handler](#Handler) * [func Cmdline(w http.ResponseWriter, r \*http.Request)](#Cmdline) * [func Index(w http.ResponseWriter, r \*http.Request)](#Index) * [func Profile(w http.ResponseWriter, r \*http.Request)](#Profile) * [func Symbol(w http.ResponseWriter, r \*http.Request)](#Symbol) ## func [Handler](http://code.google.com/p/go/source/browse/src/pkg/net/http/pprof/pprof.go?name=release#150 "View Source") ``` func Handler(name string) http.Handler ``` Handler返回一個提供name指定的剖面文件的服務的HTTP處理器。 ## func [Cmdline](http://code.google.com/p/go/source/browse/src/pkg/net/http/pprof/pprof.go?name=release#72 "View Source") ``` func Cmdline(w http.ResponseWriter, r *http.Request) ``` Cmdline回應執行中程序的命令行,采用NUL字節分隔的參數。本包將它注冊在/debug/pprof/cmdline。 ## func [Index](http://code.google.com/p/go/source/browse/src/pkg/net/http/pprof/pprof.go?name=release#173 "View Source") ``` func Index(w http.ResponseWriter, r *http.Request) ``` Index回復請求要求的pprof格式的剖面。例如,"/debug/pprof/heap"會回復"heap"剖面。Index會回復"/debug/pprof/"?請求一個列出所有可用的剖面的HTML頁面。 ## func [Profile](http://code.google.com/p/go/source/browse/src/pkg/net/http/pprof/pprof.go?name=release#79 "View Source") ``` func Profile(w http.ResponseWriter, r *http.Request) ``` Profile回復pprof格式的CPU剖面。本包將它注冊在/debug/pprof/profile。 ## func [Symbol](http://code.google.com/p/go/source/browse/src/pkg/net/http/pprof/pprof.go?name=release#104 "View Source") ``` func Symbol(w http.ResponseWriter, r *http.Request) ``` Symbol查看請求中列出的程序計數器,回復一個映射程序計數器到函數名的表格。本包將它注冊在/debug/pprof/symbol。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看