fetch_ml/cmd/profiler/main.go
Jeremie Fraeys 1dcc1e11d5
chore(build): update build system, scripts, and additional tests
- Update Makefile with native build targets (preparing for C++)
- Add profiler and performance regression detector commands
- Update CI/testing scripts
- Add additional unit tests for API, jupyter, queue, manifest
2026-02-12 12:05:55 -05:00

28 lines
558 B
Go

package main
import (
"flag"
"fmt"
"os"
"github.com/jfraeys/fetch_ml/tools"
)
func main() {
cpuProfile := flag.String("cpu-profile", "", "Path to a CPU profile file to analyze")
flag.Parse()
if *cpuProfile == "" {
_, _ = fmt.Fprintln(os.Stderr, "usage: profiler -cpu-profile <file>")
os.Exit(2)
}
p := tools.NewProfiler(tools.ProfileConfig{CPUProfile: *cpuProfile})
analysis, err := p.AnalyzeProfiles()
if err != nil {
_, _ = fmt.Fprintf(os.Stderr, "failed to analyze profiles: %v\n", err)
os.Exit(1)
}
p.PrintAnalysis(analysis)
}