Documentation ¶
Overview ¶
Package resource is a generated GoMock package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CPUUser ¶
type CPUUser interface { // CPUUsage returns the number of CPU cores of usage this user has attributed // to it. // // For example, if this user is reporting a process's CPU utilization and // that process is currently using 150% CPU (i.e. one and a half cores of // compute) then the return value will be 1.5. CPUUsage() float64 }
type Manager ¶
type Manager interface { User ProcessTracker // Shutdown allocated resources and stop tracking all processes. Shutdown() }
func NewManager ¶
func NewManager( log logging.Logger, diskPath string, frequency, cpuHalflife, diskHalflife time.Duration, metricsRegisterer prometheus.Registerer, ) (Manager, error)
type MockUser ¶
type MockUser struct {
// contains filtered or unexported fields
}
MockUser is a mock of User interface.
func NewMockUser ¶
func NewMockUser(ctrl *gomock.Controller) *MockUser
NewMockUser creates a new mock instance.
func (*MockUser) AvailableDiskBytes ¶
AvailableDiskBytes mocks base method.
func (*MockUser) EXPECT ¶
func (m *MockUser) EXPECT() *MockUserMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockUserMockRecorder ¶
type MockUserMockRecorder struct {
// contains filtered or unexported fields
}
MockUserMockRecorder is the mock recorder for MockUser.
func (*MockUserMockRecorder) AvailableDiskBytes ¶
func (mr *MockUserMockRecorder) AvailableDiskBytes() *gomock.Call
AvailableDiskBytes indicates an expected call of AvailableDiskBytes.
func (*MockUserMockRecorder) CPUUsage ¶
func (mr *MockUserMockRecorder) CPUUsage() *gomock.Call
CPUUsage indicates an expected call of CPUUsage.
func (*MockUserMockRecorder) DiskUsage ¶
func (mr *MockUserMockRecorder) DiskUsage() *gomock.Call
DiskUsage indicates an expected call of DiskUsage.
type ProcessTracker ¶
type ProcessTracker interface { // TrackProcess adds [pid] to the list of processes that this tracker is // currently managing. Duplicate requests are dropped. TrackProcess(pid int) // UntrackProcess removes [pid] from the list of processes that this tracker // is currently managing. Untracking a currently untracked [pid] is a noop. UntrackProcess(pid int) }
Click to show internal directories.
Click to hide internal directories.