hotrod-golang

command module
v0.0.0-...-aab83d0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

README

Hot R.O.D. - Rides on Demand

The project is a fork of https://github.com/jaegertracing/jaeger/tree/master/examples/hotrod. All the credits go to the authors.

We use the application in examples of how Pyroscope server pulls profiling data from remote targets.

Enable pprof endpoints

The only change we made is enabling pprof endpoints – see main.go:

func main() {
	mux := http.NewServeMux()
	mux.HandleFunc("/debug/pprof/", pprof.Index)
	mux.HandleFunc("/debug/pprof/cmdline", pprof.Cmdline)
	mux.HandleFunc("/debug/pprof/profile", pprof.Profile)
	mux.HandleFunc("/debug/pprof/symbol", pprof.Symbol)
	mux.HandleFunc("/debug/pprof/trace", pprof.Trace)
	go func() {
		log.Println(http.ListenAndServe(":6060", mux))
	}()

	cmd.Execute()
}

Note that pprof package can also register endpoints globally:

package main

import (
	"fmt"
	"net/http"
	_ "net/http/pprof"
)

func main() {
	// Server for pprof.
	go func() {
		fmt.Println(http.ListenAndServe(":6060", nil))
	}()

	// Your code.
}

Please, refer to pprof package documentation and diagnostics guide to learn more.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg
log
services

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL