mirror of
https://github.com/datarhei/core.git
synced 2025-10-05 16:07:07 +08:00
Expose resource usage in report history
This commit is contained in:
@@ -32,6 +32,7 @@ import (
|
||||
"github.com/datarhei/core/v16/monitor"
|
||||
"github.com/datarhei/core/v16/net"
|
||||
"github.com/datarhei/core/v16/prometheus"
|
||||
"github.com/datarhei/core/v16/psutil"
|
||||
"github.com/datarhei/core/v16/restream"
|
||||
restreamapp "github.com/datarhei/core/v16/restream/app"
|
||||
"github.com/datarhei/core/v16/restream/replace"
|
||||
@@ -116,6 +117,8 @@ type api struct {
|
||||
state string
|
||||
|
||||
undoMaxprocs func()
|
||||
|
||||
process psutil.Process
|
||||
}
|
||||
|
||||
// ErrConfigReload is an error returned to indicate that a reload of
|
||||
@@ -1322,6 +1325,9 @@ func (a *api) start() error {
|
||||
debug.SetMemoryLimit(math.MaxInt64)
|
||||
}
|
||||
|
||||
//p, _ := psutil.NewProcess(int32(os.Getpid()), false)
|
||||
//a.process = p
|
||||
|
||||
// Start the restream processes
|
||||
restream.Start()
|
||||
|
||||
@@ -1385,6 +1391,11 @@ func (a *api) stop() {
|
||||
a.restream = nil
|
||||
}
|
||||
|
||||
if a.process != nil {
|
||||
a.process.Stop()
|
||||
a.process = nil
|
||||
}
|
||||
|
||||
// Stop the session tracker
|
||||
if a.sessions != nil {
|
||||
a.sessions.UnregisterAll()
|
||||
|
Reference in New Issue
Block a user