Remove profiler

This commit is contained in:
Jacob Gunther
2023-08-09 19:22:48 -05:00
parent 2bf0971051
commit e1464a5616
2 changed files with 0 additions and 30 deletions

View File

@@ -4,8 +4,6 @@ import (
"fmt" "fmt"
"log" "log"
"net/http" "net/http"
"os"
"strconv"
"github.com/gofiber/fiber/v2" "github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/cors" "github.com/gofiber/fiber/v2/middleware/cors"
@@ -61,18 +59,6 @@ func init() {
} }
func main() { func main() {
if v := os.Getenv("PROFILE"); len(v) > 0 {
port, err := strconv.ParseUint(v, 10, 16)
if err != nil {
panic(err)
}
go Profile(uint16(port))
log.Printf("Profiler is listening on :%d\n", port)
}
defer r.Close() defer r.Close()
log.Printf("Listening on %s:%d\n", config.Host, config.Port+instanceID) log.Printf("Listening on %s:%d\n", config.Host, config.Port+instanceID)

View File

@@ -1,16 +0,0 @@
package main
import (
"fmt"
"log"
"net/http"
"net/http/pprof"
)
// Profile is a Goroutine for automatically profiling the program for optimization and debug reasons.
func Profile(port uint16) {
mux := http.NewServeMux()
mux.HandleFunc("/", pprof.Profile)
log.Fatal(http.ListenAndServe(fmt.Sprintf(":%d", port), mux))
}