cpu

package
v1.7.11-rc.21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 18, 2022 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Overview

Package cpu is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager interface {
	User
	ProcessTracker

	// Shutdown allocated resources and stop tracking all processes.
	Shutdown()
}

func NewManager

func NewManager(log logging.Logger, frequency, halflife time.Duration) Manager

type MockManager

type MockManager struct {
	// contains filtered or unexported fields
}

MockManager is a mock of Manager interface.

func NewMockManager

func NewMockManager(ctrl *gomock.Controller) *MockManager

NewMockManager creates a new mock instance.

func (*MockManager) Close

func (m *MockManager) Close() error

Close mocks base method.

func (*MockManager) EXPECT

func (m *MockManager) EXPECT() *MockManagerMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockManager) TrackProcess

func (m *MockManager) TrackProcess(pid int)

TrackProcess mocks base method.

func (*MockManager) UntrackProcess

func (m *MockManager) UntrackProcess(pid int)

UntrackProcess mocks base method.

func (*MockManager) Usage

func (m *MockManager) Usage() float64

Usage mocks base method.

type MockManagerMockRecorder

type MockManagerMockRecorder struct {
	// contains filtered or unexported fields
}

MockManagerMockRecorder is the mock recorder for MockManager.

func (*MockManagerMockRecorder) Close

func (mr *MockManagerMockRecorder) Close() *gomock.Call

Close indicates an expected call of Close.

func (*MockManagerMockRecorder) TrackProcess

func (mr *MockManagerMockRecorder) TrackProcess(pid interface{}) *gomock.Call

TrackProcess indicates an expected call of TrackProcess.

func (*MockManagerMockRecorder) UntrackProcess

func (mr *MockManagerMockRecorder) UntrackProcess(pid interface{}) *gomock.Call

UntrackProcess indicates an expected call of UntrackProcess.

func (*MockManagerMockRecorder) Usage

func (mr *MockManagerMockRecorder) Usage() *gomock.Call

Usage indicates an expected call of Usage.

type MockProcessTracker

type MockProcessTracker struct {
	// contains filtered or unexported fields
}

MockProcessTracker is a mock of ProcessTracker interface.

func NewMockProcessTracker

func NewMockProcessTracker(ctrl *gomock.Controller) *MockProcessTracker

NewMockProcessTracker creates a new mock instance.

func (*MockProcessTracker) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockProcessTracker) TrackProcess

func (m *MockProcessTracker) TrackProcess(pid int)

TrackProcess mocks base method.

func (*MockProcessTracker) UntrackProcess

func (m *MockProcessTracker) UntrackProcess(pid int)

UntrackProcess mocks base method.

type MockProcessTrackerMockRecorder

type MockProcessTrackerMockRecorder struct {
	// contains filtered or unexported fields
}

MockProcessTrackerMockRecorder is the mock recorder for MockProcessTracker.

func (*MockProcessTrackerMockRecorder) TrackProcess

func (mr *MockProcessTrackerMockRecorder) TrackProcess(pid interface{}) *gomock.Call

TrackProcess indicates an expected call of TrackProcess.

func (*MockProcessTrackerMockRecorder) UntrackProcess

func (mr *MockProcessTrackerMockRecorder) UntrackProcess(pid interface{}) *gomock.Call

UntrackProcess indicates an expected call of UntrackProcess.

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) EXPECT

func (m *MockUser) EXPECT() *MockUserMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockUser) Usage

func (m *MockUser) Usage() float64

Usage mocks base method.

type MockUserMockRecorder

type MockUserMockRecorder struct {
	// contains filtered or unexported fields
}

MockUserMockRecorder is the mock recorder for MockUser.

func (*MockUserMockRecorder) Usage

func (mr *MockUserMockRecorder) Usage() *gomock.Call

Usage indicates an expected call of Usage.

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)

	// TrackProcess removes [pid] from the list of processes that this tracker
	// is currently managing. Untracking a currently untracked [pid] is a noop.
	UntrackProcess(pid int)
}

type User

type User interface {
	// Usage 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.
	Usage() float64
}
var NoUsage User = noUsage{}

NoUsage implements Usage() by always returning 0.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL