mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-07-16 01:16:47 +00:00
Add flag to dump mem profile every minute
This commit is contained in:
parent
092bd5d22d
commit
cfdafecc4a
@ -80,6 +80,17 @@ func StartPassiveTapper(opts *TapOpts, outputItems chan *api.OutputChannelItem,
|
|||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if *memprofile != "" {
|
||||||
|
go func() {
|
||||||
|
for {
|
||||||
|
profilePath := profile.ProfilePath(*memprofile + "/" + time.Now().Format("2006-01-02T15:04:05-07:00"))
|
||||||
|
profile.Start(profile.MemProfileHeap, profilePath, profile.NoShutdownHook).Stop()
|
||||||
|
<-time.After(time.Second * 60)
|
||||||
|
logger.Log.Info("Stopped Mem profiling")
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
}
|
||||||
|
|
||||||
extensions = extensionsRef
|
extensions = extensionsRef
|
||||||
filteringOptions = options
|
filteringOptions = options
|
||||||
|
|
||||||
@ -251,9 +262,9 @@ func startPassiveTapper(streamsMap api.TcpStreamMap, assembler *tcpAssembler) {
|
|||||||
assembler.dumpStreamPool()
|
assembler.dumpStreamPool()
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := diagnose.DumpMemoryProfile(*memprofile); err != nil {
|
// if err := diagnose.DumpMemoryProfile(*memprofile); err != nil {
|
||||||
logger.Log.Errorf("Error dumping memory profile %v", err)
|
// logger.Log.Errorf("Error dumping memory profile %v", err)
|
||||||
}
|
// }
|
||||||
|
|
||||||
assembler.waitAndDump()
|
assembler.waitAndDump()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user