code: func Handler() http.HandlerFunc {
  	// TODO(jbd): enable block profile.
  	return func(w http.ResponseWriter, r *http.Request) {
  		switch r.URL.Query().Get("view") {
  		case "profile":
  			name := r.URL.Query().Get("name")
  			if name == "profile" {
  				httppprof.Profile(w, r)
  				return
  			}
  			httppprof.Handler(name).ServeHTTP(w, r)
  			return
  		case "symbol":
  			httppprof.Symbol(w, r)
  			return
  		}
  		n := &stats{
  			Goroutine: pprof.Lookup("goroutine").Count(),
  			Thread:    pprof.Lookup("threadcreate").Count(),
  			Block:     pprof.Lookup("block").Count(),
  			Timestamp: time.Now().Unix(),
  		}
  		err := json.NewEncoder(w).Encode(n)
  		if err != nil {
  			w.WriteHeader(500)
  			fmt.Fprint(w, err)
  		}
  	}
  }
docs: // Handler returns an http.HandlerFunc that returns pprof profiles
  // and additional metrics.
  // The handler must be accessible through the "/debug/_gom" route
  // in order for gom to display the stats from the debugged program.
  // See the godoc examples for usage.