mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-22 02:47:48 +08:00
* feat: add block profiling to collect-profiles.sh * feat: add more profiles to 'ipfs diag profile' This adds mutex and block profiles, and brings the command up-to-par with 'collect-profiles.sh', so that we can remove it. Profiles are also now collected concurrently, which improves the runtime from (profile_time * num_profiles) to just (profile_time). Note that this has a backwards-incompatible change, removing --cpu-profile-time in favor of the more general --profile-time, which covers all sampling profiles. * docs(cli): ipfs diag profile * add CLI flag to select specific diag collectors Co-authored-by: Marcin Rataj <lidel@lidel.org>
16 lines
222 B
Go
16 lines
222 B
Go
package main
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/ipfs/go-ipfs/profile"
|
|
)
|
|
|
|
func init() {
|
|
http.HandleFunc("/debug/stack",
|
|
func(w http.ResponseWriter, _ *http.Request) {
|
|
_ = profile.WriteAllGoroutineStacks(w)
|
|
},
|
|
)
|
|
}
|