implemented event and req

This commit is contained in:
2025-09-02 20:32:53 +01:00
parent 76b251dea9
commit 51f04f5f60
104 changed files with 6368 additions and 125 deletions

View File

@@ -2,18 +2,19 @@ package main
import (
"github.com/pkg/profile"
"utils.orly/interrupt"
)
func startProfiler(mode string) {
switch mode {
case "cpu":
prof := profile.Start(profile.CPUProfile)
defer prof.Stop()
interrupt.AddHandler(prof.Stop)
case "memory":
prof := profile.Start(profile.MemProfile)
defer prof.Stop()
interrupt.AddHandler(prof.Stop)
case "allocation":
prof := profile.Start(profile.MemProfileAllocs)
defer prof.Stop()
interrupt.AddHandler(prof.Stop)
}
}