From e1bdae53806905bf6aa462ef2eed2e64f8420fc8 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Sat, 7 Nov 2020 15:02:09 +0100 Subject: [PATCH] Add profiling during debugging --- main.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main.go b/main.go index 6a9453f..c984279 100644 --- a/main.go +++ b/main.go @@ -7,6 +7,7 @@ package main import ( "log" + "github.com/pkg/profile" "gitlab.crans.org/nounous/ghostream/auth" "gitlab.crans.org/nounous/ghostream/internal/config" "gitlab.crans.org/nounous/ghostream/internal/monitoring" @@ -20,6 +21,9 @@ import ( ) func main() { + // TODO Don't always profile if not needed + defer profile.Start().Stop() + // Configure logger log.SetFlags(log.Ldate | log.Ltime | log.Lshortfile)