MCPcopy Index your code
hub / github.com/bytebase/bytebase / retainMostRecentFiles

Function retainMostRecentFiles

backend/runner/monitor/monitor.go:94–106  ·  view source on GitHub ↗
(dir string, retainCount int)

Source from the content-addressed store, hash-verified

92}
93
94func retainMostRecentFiles(dir string, retainCount int) error {
95 // Handle memory dumps
96 if err := retainMostRecentFilesByPattern(dir, "memory_dump_*.prof", retainCount); err != nil {
97 return errors.Errorf("failed to retain memory dumps: %v", err)
98 }
99
100 // Handle goroutine dumps
101 if err := retainMostRecentFilesByPattern(dir, "goroutine_dump_*.prof", retainCount); err != nil {
102 return errors.Errorf("failed to retain goroutine dumps: %v", err)
103 }
104
105 return nil
106}
107
108func dumpHeapProfile(fileName string) error {
109 f, err := os.Create(fileName)

Callers 1

checkMemoryMethod · 0.85

Calls 2

ErrorfMethod · 0.80

Tested by

no test coverage detected