feat(profiling): Add CPU and MEM profiling

This commit is contained in:
2026-04-06 13:15:09 +01:00
parent 0dc77c4583
commit fb43c3d526
17 changed files with 472 additions and 2741 deletions
+5 -5
View File
@@ -1,4 +1,3 @@
// ./internal/qol/utils.go
package qol
import (
@@ -8,7 +7,7 @@ import (
"strings"
)
func GenerateOutputPaths(outputDir, upstream string, dnssec, authDNSSEC, keepAlive bool) (csvPath, pcapPath string) {
func GenerateOutputPaths(outputDir, upstream string, dnssec, authDNSSEC, keepAlive bool) (csvPath, pcapPath, memPath string) {
proto := DetectProtocol(upstream)
cleanServer := cleanServerName(upstream)
@@ -32,8 +31,10 @@ func GenerateOutputPaths(outputDir, upstream string, dnssec, authDNSSEC, keepAli
base = fmt.Sprintf("%s-%s", base, strings.Join(flags, "-"))
}
return filepath.Join(subDir, base+".csv"),
filepath.Join(subDir, base+".pcap")
csvPath = filepath.Join(subDir, base+".csv")
pcapPath = filepath.Join(subDir, base+".pcap")
memPath = filepath.Join(subDir, base+".mem.csv")
return
}
func cleanServerName(server string) string {
@@ -84,7 +85,6 @@ func DetectProtocol(upstream string) string {
u, err := url.Parse(upstream)
if err == nil && u.Scheme != "" {
scheme := strings.ToLower(u.Scheme)
// Normalize scheme names
switch scheme {
case "udp", "doudp":
return "doudp"