- 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
28 lines
558 B
Go
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)
|
|
}
|