diff options
| author | Brian Grant <bgrant0607@users.noreply.github.com> | 2015-07-19 08:45:54 -0700 |
|---|---|---|
| committer | Brian Grant <bgrant0607@users.noreply.github.com> | 2015-07-19 08:45:54 -0700 |
| commit | 56dd6eaed62545a1c1e24067f4ad8c03d8021afd (patch) | |
| tree | 229d21a249b88fd2569a9278f2ee66dca0b0c6da /profiling.md | |
| parent | 753fab889e0f6de95ba44a06b3b0c60a8fd34f5b (diff) | |
| parent | 883791a848441058457a4ab4ac50388b42396af8 (diff) | |
Merge pull request #11551 from a-robinson/docs
Improve syntax highlighting for design and devel docs
Diffstat (limited to 'profiling.md')
| -rw-r--r-- | profiling.md | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/profiling.md b/profiling.md index 816e600c..f563ce0a 100644 --- a/profiling.md +++ b/profiling.md @@ -43,10 +43,10 @@ Go comes with inbuilt 'net/http/pprof' profiling library and profiling web servi TL;DR: Add lines: -``` - m.mux.HandleFunc("/debug/pprof/", pprof.Index) - m.mux.HandleFunc("/debug/pprof/profile", pprof.Profile) - m.mux.HandleFunc("/debug/pprof/symbol", pprof.Symbol) +```go +m.mux.HandleFunc("/debug/pprof/", pprof.Index) +m.mux.HandleFunc("/debug/pprof/profile", pprof.Profile) +m.mux.HandleFunc("/debug/pprof/symbol", pprof.Symbol) ``` to the init(c *Config) method in 'pkg/master/master.go' and import 'net/http/pprof' package. @@ -57,13 +57,13 @@ In most use cases to use profiler service it's enough to do 'import _ net/http/p Even when running profiler I found not really straightforward to use 'go tool pprof' with it. The problem is that at least for dev purposes certificates generated for APIserver are not signed by anyone trusted and because secureServer serves only secure traffic it isn't straightforward to connect to the service. The best workaround I found is by creating an ssh tunnel from the kubernetes_master open unsecured port to some external server, and use this server as a proxy. To save everyone looking for correct ssh flags, it is done by running: -``` - ssh kubernetes_master -L<local_port>:localhost:8080 +```sh +ssh kubernetes_master -L<local_port>:localhost:8080 ``` or analogous one for you Cloud provider. Afterwards you can e.g. run -``` +```sh go tool pprof http://localhost:<local_port>/debug/pprof/profile ``` |
