Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Component = compogo.Component{ Name: "resource.manager", Dependencies: compogo.Components{ &manager.Component, &repeater.Component, }, Init: compogo.StepFunc(func(container compogo.Container) error { return container.Provide(NewManager) }), Execute: compogo.StepFunc(func(container compogo.Container) error { return container.Invoke(func(r repeater.Repeater, config *manager.Config, m *Manager) error { return r.AddProcess(repeater.NewTask("resource.manager", config.Delay, m.Process)) }) }), }
Component — компонент менеджера ресурсов. Запускает периодический сбор статистики через Repeater.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
OnChangeResource emitter.Emitter[*domain.Resource]
// contains filtered or unexported fields
}
Manager — менеджер ресурсов. Собирает статистику использования CPU и Memory через cgroup. При изменении ресурсов генерирует событие OnChangeResource.
func NewManager ¶
NewManager создаёт новый менеджер ресурсов.
Click to show internal directories.
Click to hide internal directories.