Documentation ¶
Overview ¶
Package rcmgr is a generated GoMock package.
Package rcmgr is a generated GoMock package.
Index ¶
- Constants
- type Direction
- type Limit
- type Limiter
- type MockLimit
- func (m *MockLimit) Add(arg0 Limit)
- func (m *MockLimit) EXPECT() *MockLimitMockRecorder
- func (m *MockLimit) Equal(arg0 Limit) bool
- func (m *MockLimit) GetConnLimit(arg0 Direction) int
- func (m *MockLimit) GetConnTotalLimit() int
- func (m *MockLimit) GetFDLimit() int
- func (m *MockLimit) GetMemoryLimit() int64
- func (m *MockLimit) GetTaskLimit(arg0 ReserveTaskPriority) int
- func (m *MockLimit) GetTaskTotalLimit() int
- func (m *MockLimit) NotLess(arg0 Limit) bool
- func (m *MockLimit) ScopeStat() *ScopeStat
- func (m *MockLimit) String() string
- func (m *MockLimit) Sub(arg0 Limit) bool
- type MockLimitMockRecorder
- func (mr *MockLimitMockRecorder) Add(arg0 interface{}) *gomock.Call
- func (mr *MockLimitMockRecorder) Equal(arg0 interface{}) *gomock.Call
- func (mr *MockLimitMockRecorder) GetConnLimit(arg0 interface{}) *gomock.Call
- func (mr *MockLimitMockRecorder) GetConnTotalLimit() *gomock.Call
- func (mr *MockLimitMockRecorder) GetFDLimit() *gomock.Call
- func (mr *MockLimitMockRecorder) GetMemoryLimit() *gomock.Call
- func (mr *MockLimitMockRecorder) GetTaskLimit(arg0 interface{}) *gomock.Call
- func (mr *MockLimitMockRecorder) GetTaskTotalLimit() *gomock.Call
- func (mr *MockLimitMockRecorder) NotLess(arg0 interface{}) *gomock.Call
- func (mr *MockLimitMockRecorder) ScopeStat() *gomock.Call
- func (mr *MockLimitMockRecorder) String() *gomock.Call
- func (mr *MockLimitMockRecorder) Sub(arg0 interface{}) *gomock.Call
- type MockLimiter
- type MockLimiterMockRecorder
- type MockResourceManager
- func (m *MockResourceManager) Close() error
- func (m *MockResourceManager) EXPECT() *MockResourceManagerMockRecorder
- func (m *MockResourceManager) OpenService(svc string) (ResourceScope, error)
- func (m *MockResourceManager) ServiceState(arg0 string) string
- func (m *MockResourceManager) SystemState() string
- func (m *MockResourceManager) TransientState() string
- func (m *MockResourceManager) ViewService(arg0 string, arg1 func(ResourceScope) error) error
- func (m *MockResourceManager) ViewSystem(arg0 func(ResourceScope) error) error
- func (m *MockResourceManager) ViewTransient(arg0 func(ResourceScope) error) error
- type MockResourceManagerMockRecorder
- func (mr *MockResourceManagerMockRecorder) Close() *gomock.Call
- func (mr *MockResourceManagerMockRecorder) OpenService(svc interface{}) *gomock.Call
- func (mr *MockResourceManagerMockRecorder) ServiceState(arg0 interface{}) *gomock.Call
- func (mr *MockResourceManagerMockRecorder) SystemState() *gomock.Call
- func (mr *MockResourceManagerMockRecorder) TransientState() *gomock.Call
- func (mr *MockResourceManagerMockRecorder) ViewService(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockResourceManagerMockRecorder) ViewSystem(arg0 interface{}) *gomock.Call
- func (mr *MockResourceManagerMockRecorder) ViewTransient(arg0 interface{}) *gomock.Call
- type MockResourceScope
- func (m *MockResourceScope) AddConn(dir Direction) error
- func (m *MockResourceScope) AddTask(num int, prio ReserveTaskPriority) error
- func (m *MockResourceScope) BeginSpan() (ResourceScopeSpan, error)
- func (m *MockResourceScope) EXPECT() *MockResourceScopeMockRecorder
- func (m *MockResourceScope) Name() string
- func (m *MockResourceScope) Release()
- func (m *MockResourceScope) ReleaseMemory(size int64)
- func (m *MockResourceScope) RemainingResource() (Limit, error)
- func (m *MockResourceScope) RemoveConn(dir Direction)
- func (m *MockResourceScope) RemoveTask(num int, prio ReserveTaskPriority)
- func (m *MockResourceScope) ReserveMemory(size int64, prio uint8) error
- func (m *MockResourceScope) ReserveResources(st *ScopeStat) error
- func (m *MockResourceScope) Stat() ScopeStat
- type MockResourceScopeMockRecorder
- func (mr *MockResourceScopeMockRecorder) AddConn(dir interface{}) *gomock.Call
- func (mr *MockResourceScopeMockRecorder) AddTask(num, prio interface{}) *gomock.Call
- func (mr *MockResourceScopeMockRecorder) BeginSpan() *gomock.Call
- func (mr *MockResourceScopeMockRecorder) Name() *gomock.Call
- func (mr *MockResourceScopeMockRecorder) Release() *gomock.Call
- func (mr *MockResourceScopeMockRecorder) ReleaseMemory(size interface{}) *gomock.Call
- func (mr *MockResourceScopeMockRecorder) RemainingResource() *gomock.Call
- func (mr *MockResourceScopeMockRecorder) RemoveConn(dir interface{}) *gomock.Call
- func (mr *MockResourceScopeMockRecorder) RemoveTask(num, prio interface{}) *gomock.Call
- func (mr *MockResourceScopeMockRecorder) ReserveMemory(size, prio interface{}) *gomock.Call
- func (mr *MockResourceScopeMockRecorder) ReserveResources(st interface{}) *gomock.Call
- func (mr *MockResourceScopeMockRecorder) Stat() *gomock.Call
- type MockResourceScopeSpan
- func (m *MockResourceScopeSpan) AddConn(dir Direction) error
- func (m *MockResourceScopeSpan) AddTask(num int, prio ReserveTaskPriority) error
- func (m *MockResourceScopeSpan) BeginSpan() (ResourceScopeSpan, error)
- func (m *MockResourceScopeSpan) Done()
- func (m *MockResourceScopeSpan) EXPECT() *MockResourceScopeSpanMockRecorder
- func (m *MockResourceScopeSpan) Name() string
- func (m *MockResourceScopeSpan) Release()
- func (m *MockResourceScopeSpan) ReleaseMemory(size int64)
- func (m *MockResourceScopeSpan) RemainingResource() (Limit, error)
- func (m *MockResourceScopeSpan) RemoveConn(dir Direction)
- func (m *MockResourceScopeSpan) RemoveTask(num int, prio ReserveTaskPriority)
- func (m *MockResourceScopeSpan) ReserveMemory(size int64, prio uint8) error
- func (m *MockResourceScopeSpan) ReserveResources(st *ScopeStat) error
- func (m *MockResourceScopeSpan) Stat() ScopeStat
- type MockResourceScopeSpanMockRecorder
- func (mr *MockResourceScopeSpanMockRecorder) AddConn(dir interface{}) *gomock.Call
- func (mr *MockResourceScopeSpanMockRecorder) AddTask(num, prio interface{}) *gomock.Call
- func (mr *MockResourceScopeSpanMockRecorder) BeginSpan() *gomock.Call
- func (mr *MockResourceScopeSpanMockRecorder) Done() *gomock.Call
- func (mr *MockResourceScopeSpanMockRecorder) Name() *gomock.Call
- func (mr *MockResourceScopeSpanMockRecorder) Release() *gomock.Call
- func (mr *MockResourceScopeSpanMockRecorder) ReleaseMemory(size interface{}) *gomock.Call
- func (mr *MockResourceScopeSpanMockRecorder) RemainingResource() *gomock.Call
- func (mr *MockResourceScopeSpanMockRecorder) RemoveConn(dir interface{}) *gomock.Call
- func (mr *MockResourceScopeSpanMockRecorder) RemoveTask(num, prio interface{}) *gomock.Call
- func (mr *MockResourceScopeSpanMockRecorder) ReserveMemory(size, prio interface{}) *gomock.Call
- func (mr *MockResourceScopeSpanMockRecorder) ReserveResources(st interface{}) *gomock.Call
- func (mr *MockResourceScopeSpanMockRecorder) Stat() *gomock.Call
- type MockResourceScopeViewer
- func (m *MockResourceScopeViewer) EXPECT() *MockResourceScopeViewerMockRecorder
- func (m *MockResourceScopeViewer) ServiceState(arg0 string) string
- func (m *MockResourceScopeViewer) SystemState() string
- func (m *MockResourceScopeViewer) TransientState() string
- func (m *MockResourceScopeViewer) ViewService(arg0 string, arg1 func(ResourceScope) error) error
- func (m *MockResourceScopeViewer) ViewSystem(arg0 func(ResourceScope) error) error
- func (m *MockResourceScopeViewer) ViewTransient(arg0 func(ResourceScope) error) error
- type MockResourceScopeViewerMockRecorder
- func (mr *MockResourceScopeViewerMockRecorder) ServiceState(arg0 interface{}) *gomock.Call
- func (mr *MockResourceScopeViewerMockRecorder) SystemState() *gomock.Call
- func (mr *MockResourceScopeViewerMockRecorder) TransientState() *gomock.Call
- func (mr *MockResourceScopeViewerMockRecorder) ViewService(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockResourceScopeViewerMockRecorder) ViewSystem(arg0 interface{}) *gomock.Call
- func (mr *MockResourceScopeViewerMockRecorder) ViewTransient(arg0 interface{}) *gomock.Call
- type NullLimit
- func (n *NullLimit) Add(Limit)
- func (n *NullLimit) Equal(Limit) bool
- func (n *NullLimit) GetConnLimit(Direction) int
- func (n *NullLimit) GetConnTotalLimit() int
- func (n *NullLimit) GetFDLimit() int
- func (n *NullLimit) GetMemoryLimit() int64
- func (n *NullLimit) GetServiceLimits(svc string) Limit
- func (n *NullLimit) GetSystemLimits() Limit
- func (n *NullLimit) GetTaskLimit(ReserveTaskPriority) int
- func (n *NullLimit) GetTaskTotalLimit() int
- func (n *NullLimit) GetTransientLimits() Limit
- func (n *NullLimit) NotLess(Limit) bool
- func (n *NullLimit) ScopeStat() *ScopeStat
- func (n *NullLimit) String() string
- func (n *NullLimit) Sub(Limit) bool
- type NullResourceManager
- func (n *NullResourceManager) Close() error
- func (n *NullResourceManager) OpenService(svc string) (ResourceScope, error)
- func (n *NullResourceManager) ServiceLimitString(string, func(ResourceScope) string) string
- func (n *NullResourceManager) ServiceState(string) string
- func (n *NullResourceManager) SystemLimitString(func(ResourceScope) string) string
- func (n *NullResourceManager) SystemState() string
- func (n *NullResourceManager) TransientLimitString(func(ResourceScope) string) string
- func (n *NullResourceManager) TransientState() string
- func (n *NullResourceManager) ViewService(svc string, f func(ResourceScope) error) error
- func (n *NullResourceManager) ViewSystem(f func(ResourceScope) error) error
- func (n *NullResourceManager) ViewTransient(f func(ResourceScope) error) error
- type NullScope
- func (n *NullScope) AddConn(dir Direction) error
- func (n *NullScope) AddTask(num int, prio ReserveTaskPriority) error
- func (n *NullScope) BeginSpan() (ResourceScopeSpan, error)
- func (n *NullScope) Done()
- func (n *NullScope) Name() string
- func (n *NullScope) Release()
- func (n *NullScope) ReleaseMemory(size int64)
- func (n *NullScope) RemainingResource() (Limit, error)
- func (n *NullScope) RemoveConn(dir Direction)
- func (n *NullScope) RemoveTask(num int, prio ReserveTaskPriority)
- func (n *NullScope) ReserveMemory(size int64, prio uint8) error
- func (n *NullScope) ReserveResources(st *ScopeStat) error
- func (n *NullScope) Stat() ScopeStat
- type ReserveTaskPriority
- type ResourceManager
- type ResourceScope
- type ResourceScopeSpan
- type ResourceScopeViewer
- type ScopeStat
- type Unlimited
- func (n *Unlimited) Add(Limit)
- func (n *Unlimited) Equal(Limit) bool
- func (n *Unlimited) GetConnLimit(Direction) int
- func (n *Unlimited) GetConnTotalLimit() int
- func (n *Unlimited) GetFDLimit() int
- func (n *Unlimited) GetMemoryLimit() int64
- func (n *Unlimited) GetServiceLimits(svc string) Limit
- func (n *Unlimited) GetSystemLimits() Limit
- func (n *Unlimited) GetTaskLimit(ReserveTaskPriority) int
- func (n *Unlimited) GetTaskTotalLimit() int
- func (n *Unlimited) GetTransientLimits() Limit
- func (n *Unlimited) NotLess(Limit) bool
- func (n *Unlimited) ScopeStat() *ScopeStat
- func (n *Unlimited) String() string
- func (n *Unlimited) Sub(Limit) bool
Constants ¶
const ( MaxLimitInt64 = math.MaxInt64 MaxLimitInt = math.MaxInt )
const ( // ReservationPriorityLow is a reservation priority that indicates a reservation if the scope // memory utilization is at 40% or less. ReservationPriorityLow uint8 = 101 // ReservationPriorityMedium is a reservation priority that indicates a reservation if the scope // memory utilization is at 60% or less. ReservationPriorityMedium uint8 = 152 // ReservationPriorityHigh is a reservation priority that indicates a reservation if the scope // memory utilization is at 80% or less. ReservationPriorityHigh uint8 = 203 // ReservationPriorityAlways is a reservation priority that indicates a reservation if there is // enough memory, regardless of scope utilization. ReservationPriorityAlways uint8 = 255 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Direction ¶
type Direction int
Direction represents which peer in a stream initiated a connection.
type Limit ¶
type Limit interface { // GetMemoryLimit returns the (current) memory limit. GetMemoryLimit() int64 // GetFDLimit returns the file descriptor limit. GetFDLimit() int // GetConnLimit returns the connection limit, for inbound or outbound connections. GetConnLimit(Direction) int // GetConnTotalLimit returns the total connection limit. GetConnTotalLimit() int // GetTaskLimit returns the task limit, for high, medium and low priority tasks. GetTaskLimit(ReserveTaskPriority) int // GetTaskTotalLimit returns the total task limit. GetTaskTotalLimit() int ScopeStat() *ScopeStat // NotLess returns an indicator whether cover the param limit fields. NotLess(Limit) bool // Add params limits fields value to self. Add(Limit) // Sub params limits fields value to self. Sub(Limit) bool // Equal returns an indicator whether equal the param limit. Equal(Limit) bool // String returns the Limit state string. String() string }
Limit is an interface that that specifies basic resource limits.
type Limiter ¶
type Limiter interface { // GetSystemLimits returns the system limits. GetSystemLimits() Limit // GetTransientLimits returns the transient limits. GetTransientLimits() Limit // GetServiceLimits returns a service-specific limits. GetServiceLimits(svc string) Limit // String returns the all kinds of Limit state string String() string }
Limiter is an interface for providing limits to the resource manager.
type MockLimit ¶ added in v0.2.4
type MockLimit struct {
// contains filtered or unexported fields
}
MockLimit is a mock of Limit interface.
func NewMockLimit ¶ added in v0.2.4
func NewMockLimit(ctrl *gomock.Controller) *MockLimit
NewMockLimit creates a new mock instance.
func (*MockLimit) EXPECT ¶ added in v0.2.4
func (m *MockLimit) EXPECT() *MockLimitMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockLimit) GetConnLimit ¶ added in v0.2.4
GetConnLimit mocks base method.
func (*MockLimit) GetConnTotalLimit ¶ added in v0.2.4
GetConnTotalLimit mocks base method.
func (*MockLimit) GetFDLimit ¶ added in v0.2.4
GetFDLimit mocks base method.
func (*MockLimit) GetMemoryLimit ¶ added in v0.2.4
GetMemoryLimit mocks base method.
func (*MockLimit) GetTaskLimit ¶ added in v0.2.4
func (m *MockLimit) GetTaskLimit(arg0 ReserveTaskPriority) int
GetTaskLimit mocks base method.
func (*MockLimit) GetTaskTotalLimit ¶ added in v0.2.4
GetTaskTotalLimit mocks base method.
type MockLimitMockRecorder ¶ added in v0.2.4
type MockLimitMockRecorder struct {
// contains filtered or unexported fields
}
MockLimitMockRecorder is the mock recorder for MockLimit.
func (*MockLimitMockRecorder) Add ¶ added in v0.2.4
func (mr *MockLimitMockRecorder) Add(arg0 interface{}) *gomock.Call
Add indicates an expected call of Add.
func (*MockLimitMockRecorder) Equal ¶ added in v0.2.4
func (mr *MockLimitMockRecorder) Equal(arg0 interface{}) *gomock.Call
Equal indicates an expected call of Equal.
func (*MockLimitMockRecorder) GetConnLimit ¶ added in v0.2.4
func (mr *MockLimitMockRecorder) GetConnLimit(arg0 interface{}) *gomock.Call
GetConnLimit indicates an expected call of GetConnLimit.
func (*MockLimitMockRecorder) GetConnTotalLimit ¶ added in v0.2.4
func (mr *MockLimitMockRecorder) GetConnTotalLimit() *gomock.Call
GetConnTotalLimit indicates an expected call of GetConnTotalLimit.
func (*MockLimitMockRecorder) GetFDLimit ¶ added in v0.2.4
func (mr *MockLimitMockRecorder) GetFDLimit() *gomock.Call
GetFDLimit indicates an expected call of GetFDLimit.
func (*MockLimitMockRecorder) GetMemoryLimit ¶ added in v0.2.4
func (mr *MockLimitMockRecorder) GetMemoryLimit() *gomock.Call
GetMemoryLimit indicates an expected call of GetMemoryLimit.
func (*MockLimitMockRecorder) GetTaskLimit ¶ added in v0.2.4
func (mr *MockLimitMockRecorder) GetTaskLimit(arg0 interface{}) *gomock.Call
GetTaskLimit indicates an expected call of GetTaskLimit.
func (*MockLimitMockRecorder) GetTaskTotalLimit ¶ added in v0.2.4
func (mr *MockLimitMockRecorder) GetTaskTotalLimit() *gomock.Call
GetTaskTotalLimit indicates an expected call of GetTaskTotalLimit.
func (*MockLimitMockRecorder) NotLess ¶ added in v0.2.4
func (mr *MockLimitMockRecorder) NotLess(arg0 interface{}) *gomock.Call
NotLess indicates an expected call of NotLess.
func (*MockLimitMockRecorder) ScopeStat ¶ added in v0.2.4
func (mr *MockLimitMockRecorder) ScopeStat() *gomock.Call
ScopeStat indicates an expected call of ScopeStat.
func (*MockLimitMockRecorder) String ¶ added in v0.2.4
func (mr *MockLimitMockRecorder) String() *gomock.Call
String indicates an expected call of String.
func (*MockLimitMockRecorder) Sub ¶ added in v0.2.4
func (mr *MockLimitMockRecorder) Sub(arg0 interface{}) *gomock.Call
Sub indicates an expected call of Sub.
type MockLimiter ¶ added in v0.2.4
type MockLimiter struct {
// contains filtered or unexported fields
}
MockLimiter is a mock of Limiter interface.
func NewMockLimiter ¶ added in v0.2.4
func NewMockLimiter(ctrl *gomock.Controller) *MockLimiter
NewMockLimiter creates a new mock instance.
func (*MockLimiter) EXPECT ¶ added in v0.2.4
func (m *MockLimiter) EXPECT() *MockLimiterMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockLimiter) GetServiceLimits ¶ added in v0.2.4
func (m *MockLimiter) GetServiceLimits(svc string) Limit
GetServiceLimits mocks base method.
func (*MockLimiter) GetSystemLimits ¶ added in v0.2.4
func (m *MockLimiter) GetSystemLimits() Limit
GetSystemLimits mocks base method.
func (*MockLimiter) GetTransientLimits ¶ added in v0.2.4
func (m *MockLimiter) GetTransientLimits() Limit
GetTransientLimits mocks base method.
func (*MockLimiter) String ¶ added in v0.2.4
func (m *MockLimiter) String() string
String mocks base method.
type MockLimiterMockRecorder ¶ added in v0.2.4
type MockLimiterMockRecorder struct {
// contains filtered or unexported fields
}
MockLimiterMockRecorder is the mock recorder for MockLimiter.
func (*MockLimiterMockRecorder) GetServiceLimits ¶ added in v0.2.4
func (mr *MockLimiterMockRecorder) GetServiceLimits(svc interface{}) *gomock.Call
GetServiceLimits indicates an expected call of GetServiceLimits.
func (*MockLimiterMockRecorder) GetSystemLimits ¶ added in v0.2.4
func (mr *MockLimiterMockRecorder) GetSystemLimits() *gomock.Call
GetSystemLimits indicates an expected call of GetSystemLimits.
func (*MockLimiterMockRecorder) GetTransientLimits ¶ added in v0.2.4
func (mr *MockLimiterMockRecorder) GetTransientLimits() *gomock.Call
GetTransientLimits indicates an expected call of GetTransientLimits.
func (*MockLimiterMockRecorder) String ¶ added in v0.2.4
func (mr *MockLimiterMockRecorder) String() *gomock.Call
String indicates an expected call of String.
type MockResourceManager ¶ added in v0.2.4
type MockResourceManager struct {
// contains filtered or unexported fields
}
MockResourceManager is a mock of ResourceManager interface.
func NewMockResourceManager ¶ added in v0.2.4
func NewMockResourceManager(ctrl *gomock.Controller) *MockResourceManager
NewMockResourceManager creates a new mock instance.
func (*MockResourceManager) Close ¶ added in v0.2.4
func (m *MockResourceManager) Close() error
Close mocks base method.
func (*MockResourceManager) EXPECT ¶ added in v0.2.4
func (m *MockResourceManager) EXPECT() *MockResourceManagerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockResourceManager) OpenService ¶ added in v0.2.4
func (m *MockResourceManager) OpenService(svc string) (ResourceScope, error)
OpenService mocks base method.
func (*MockResourceManager) ServiceState ¶ added in v0.2.4
func (m *MockResourceManager) ServiceState(arg0 string) string
ServiceState mocks base method.
func (*MockResourceManager) SystemState ¶ added in v0.2.4
func (m *MockResourceManager) SystemState() string
SystemState mocks base method.
func (*MockResourceManager) TransientState ¶ added in v0.2.4
func (m *MockResourceManager) TransientState() string
TransientState mocks base method.
func (*MockResourceManager) ViewService ¶ added in v0.2.4
func (m *MockResourceManager) ViewService(arg0 string, arg1 func(ResourceScope) error) error
ViewService mocks base method.
func (*MockResourceManager) ViewSystem ¶ added in v0.2.4
func (m *MockResourceManager) ViewSystem(arg0 func(ResourceScope) error) error
ViewSystem mocks base method.
func (*MockResourceManager) ViewTransient ¶ added in v0.2.4
func (m *MockResourceManager) ViewTransient(arg0 func(ResourceScope) error) error
ViewTransient mocks base method.
type MockResourceManagerMockRecorder ¶ added in v0.2.4
type MockResourceManagerMockRecorder struct {
// contains filtered or unexported fields
}
MockResourceManagerMockRecorder is the mock recorder for MockResourceManager.
func (*MockResourceManagerMockRecorder) Close ¶ added in v0.2.4
func (mr *MockResourceManagerMockRecorder) Close() *gomock.Call
Close indicates an expected call of Close.
func (*MockResourceManagerMockRecorder) OpenService ¶ added in v0.2.4
func (mr *MockResourceManagerMockRecorder) OpenService(svc interface{}) *gomock.Call
OpenService indicates an expected call of OpenService.
func (*MockResourceManagerMockRecorder) ServiceState ¶ added in v0.2.4
func (mr *MockResourceManagerMockRecorder) ServiceState(arg0 interface{}) *gomock.Call
ServiceState indicates an expected call of ServiceState.
func (*MockResourceManagerMockRecorder) SystemState ¶ added in v0.2.4
func (mr *MockResourceManagerMockRecorder) SystemState() *gomock.Call
SystemState indicates an expected call of SystemState.
func (*MockResourceManagerMockRecorder) TransientState ¶ added in v0.2.4
func (mr *MockResourceManagerMockRecorder) TransientState() *gomock.Call
TransientState indicates an expected call of TransientState.
func (*MockResourceManagerMockRecorder) ViewService ¶ added in v0.2.4
func (mr *MockResourceManagerMockRecorder) ViewService(arg0, arg1 interface{}) *gomock.Call
ViewService indicates an expected call of ViewService.
func (*MockResourceManagerMockRecorder) ViewSystem ¶ added in v0.2.4
func (mr *MockResourceManagerMockRecorder) ViewSystem(arg0 interface{}) *gomock.Call
ViewSystem indicates an expected call of ViewSystem.
func (*MockResourceManagerMockRecorder) ViewTransient ¶ added in v0.2.4
func (mr *MockResourceManagerMockRecorder) ViewTransient(arg0 interface{}) *gomock.Call
ViewTransient indicates an expected call of ViewTransient.
type MockResourceScope ¶ added in v0.2.4
type MockResourceScope struct {
// contains filtered or unexported fields
}
MockResourceScope is a mock of ResourceScope interface.
func NewMockResourceScope ¶ added in v0.2.4
func NewMockResourceScope(ctrl *gomock.Controller) *MockResourceScope
NewMockResourceScope creates a new mock instance.
func (*MockResourceScope) AddConn ¶ added in v0.2.4
func (m *MockResourceScope) AddConn(dir Direction) error
AddConn mocks base method.
func (*MockResourceScope) AddTask ¶ added in v0.2.4
func (m *MockResourceScope) AddTask(num int, prio ReserveTaskPriority) error
AddTask mocks base method.
func (*MockResourceScope) BeginSpan ¶ added in v0.2.4
func (m *MockResourceScope) BeginSpan() (ResourceScopeSpan, error)
BeginSpan mocks base method.
func (*MockResourceScope) EXPECT ¶ added in v0.2.4
func (m *MockResourceScope) EXPECT() *MockResourceScopeMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockResourceScope) Name ¶ added in v0.2.4
func (m *MockResourceScope) Name() string
Name mocks base method.
func (*MockResourceScope) Release ¶ added in v0.2.4
func (m *MockResourceScope) Release()
Release mocks base method.
func (*MockResourceScope) ReleaseMemory ¶ added in v0.2.4
func (m *MockResourceScope) ReleaseMemory(size int64)
ReleaseMemory mocks base method.
func (*MockResourceScope) RemainingResource ¶ added in v0.2.4
func (m *MockResourceScope) RemainingResource() (Limit, error)
RemainingResource mocks base method.
func (*MockResourceScope) RemoveConn ¶ added in v0.2.4
func (m *MockResourceScope) RemoveConn(dir Direction)
RemoveConn mocks base method.
func (*MockResourceScope) RemoveTask ¶ added in v0.2.4
func (m *MockResourceScope) RemoveTask(num int, prio ReserveTaskPriority)
RemoveTask mocks base method.
func (*MockResourceScope) ReserveMemory ¶ added in v0.2.4
func (m *MockResourceScope) ReserveMemory(size int64, prio uint8) error
ReserveMemory mocks base method.
func (*MockResourceScope) ReserveResources ¶ added in v0.2.4
func (m *MockResourceScope) ReserveResources(st *ScopeStat) error
ReserveResources mocks base method.
func (*MockResourceScope) Stat ¶ added in v0.2.4
func (m *MockResourceScope) Stat() ScopeStat
Stat mocks base method.
type MockResourceScopeMockRecorder ¶ added in v0.2.4
type MockResourceScopeMockRecorder struct {
// contains filtered or unexported fields
}
MockResourceScopeMockRecorder is the mock recorder for MockResourceScope.
func (*MockResourceScopeMockRecorder) AddConn ¶ added in v0.2.4
func (mr *MockResourceScopeMockRecorder) AddConn(dir interface{}) *gomock.Call
AddConn indicates an expected call of AddConn.
func (*MockResourceScopeMockRecorder) AddTask ¶ added in v0.2.4
func (mr *MockResourceScopeMockRecorder) AddTask(num, prio interface{}) *gomock.Call
AddTask indicates an expected call of AddTask.
func (*MockResourceScopeMockRecorder) BeginSpan ¶ added in v0.2.4
func (mr *MockResourceScopeMockRecorder) BeginSpan() *gomock.Call
BeginSpan indicates an expected call of BeginSpan.
func (*MockResourceScopeMockRecorder) Name ¶ added in v0.2.4
func (mr *MockResourceScopeMockRecorder) Name() *gomock.Call
Name indicates an expected call of Name.
func (*MockResourceScopeMockRecorder) Release ¶ added in v0.2.4
func (mr *MockResourceScopeMockRecorder) Release() *gomock.Call
Release indicates an expected call of Release.
func (*MockResourceScopeMockRecorder) ReleaseMemory ¶ added in v0.2.4
func (mr *MockResourceScopeMockRecorder) ReleaseMemory(size interface{}) *gomock.Call
ReleaseMemory indicates an expected call of ReleaseMemory.
func (*MockResourceScopeMockRecorder) RemainingResource ¶ added in v0.2.4
func (mr *MockResourceScopeMockRecorder) RemainingResource() *gomock.Call
RemainingResource indicates an expected call of RemainingResource.
func (*MockResourceScopeMockRecorder) RemoveConn ¶ added in v0.2.4
func (mr *MockResourceScopeMockRecorder) RemoveConn(dir interface{}) *gomock.Call
RemoveConn indicates an expected call of RemoveConn.
func (*MockResourceScopeMockRecorder) RemoveTask ¶ added in v0.2.4
func (mr *MockResourceScopeMockRecorder) RemoveTask(num, prio interface{}) *gomock.Call
RemoveTask indicates an expected call of RemoveTask.
func (*MockResourceScopeMockRecorder) ReserveMemory ¶ added in v0.2.4
func (mr *MockResourceScopeMockRecorder) ReserveMemory(size, prio interface{}) *gomock.Call
ReserveMemory indicates an expected call of ReserveMemory.
func (*MockResourceScopeMockRecorder) ReserveResources ¶ added in v0.2.4
func (mr *MockResourceScopeMockRecorder) ReserveResources(st interface{}) *gomock.Call
ReserveResources indicates an expected call of ReserveResources.
func (*MockResourceScopeMockRecorder) Stat ¶ added in v0.2.4
func (mr *MockResourceScopeMockRecorder) Stat() *gomock.Call
Stat indicates an expected call of Stat.
type MockResourceScopeSpan ¶ added in v0.2.4
type MockResourceScopeSpan struct {
// contains filtered or unexported fields
}
MockResourceScopeSpan is a mock of ResourceScopeSpan interface.
func NewMockResourceScopeSpan ¶ added in v0.2.4
func NewMockResourceScopeSpan(ctrl *gomock.Controller) *MockResourceScopeSpan
NewMockResourceScopeSpan creates a new mock instance.
func (*MockResourceScopeSpan) AddConn ¶ added in v0.2.4
func (m *MockResourceScopeSpan) AddConn(dir Direction) error
AddConn mocks base method.
func (*MockResourceScopeSpan) AddTask ¶ added in v0.2.4
func (m *MockResourceScopeSpan) AddTask(num int, prio ReserveTaskPriority) error
AddTask mocks base method.
func (*MockResourceScopeSpan) BeginSpan ¶ added in v0.2.4
func (m *MockResourceScopeSpan) BeginSpan() (ResourceScopeSpan, error)
BeginSpan mocks base method.
func (*MockResourceScopeSpan) Done ¶ added in v0.2.4
func (m *MockResourceScopeSpan) Done()
Done mocks base method.
func (*MockResourceScopeSpan) EXPECT ¶ added in v0.2.4
func (m *MockResourceScopeSpan) EXPECT() *MockResourceScopeSpanMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockResourceScopeSpan) Name ¶ added in v0.2.4
func (m *MockResourceScopeSpan) Name() string
Name mocks base method.
func (*MockResourceScopeSpan) Release ¶ added in v0.2.4
func (m *MockResourceScopeSpan) Release()
Release mocks base method.
func (*MockResourceScopeSpan) ReleaseMemory ¶ added in v0.2.4
func (m *MockResourceScopeSpan) ReleaseMemory(size int64)
ReleaseMemory mocks base method.
func (*MockResourceScopeSpan) RemainingResource ¶ added in v0.2.4
func (m *MockResourceScopeSpan) RemainingResource() (Limit, error)
RemainingResource mocks base method.
func (*MockResourceScopeSpan) RemoveConn ¶ added in v0.2.4
func (m *MockResourceScopeSpan) RemoveConn(dir Direction)
RemoveConn mocks base method.
func (*MockResourceScopeSpan) RemoveTask ¶ added in v0.2.4
func (m *MockResourceScopeSpan) RemoveTask(num int, prio ReserveTaskPriority)
RemoveTask mocks base method.
func (*MockResourceScopeSpan) ReserveMemory ¶ added in v0.2.4
func (m *MockResourceScopeSpan) ReserveMemory(size int64, prio uint8) error
ReserveMemory mocks base method.
func (*MockResourceScopeSpan) ReserveResources ¶ added in v0.2.4
func (m *MockResourceScopeSpan) ReserveResources(st *ScopeStat) error
ReserveResources mocks base method.
func (*MockResourceScopeSpan) Stat ¶ added in v0.2.4
func (m *MockResourceScopeSpan) Stat() ScopeStat
Stat mocks base method.
type MockResourceScopeSpanMockRecorder ¶ added in v0.2.4
type MockResourceScopeSpanMockRecorder struct {
// contains filtered or unexported fields
}
MockResourceScopeSpanMockRecorder is the mock recorder for MockResourceScopeSpan.
func (*MockResourceScopeSpanMockRecorder) AddConn ¶ added in v0.2.4
func (mr *MockResourceScopeSpanMockRecorder) AddConn(dir interface{}) *gomock.Call
AddConn indicates an expected call of AddConn.
func (*MockResourceScopeSpanMockRecorder) AddTask ¶ added in v0.2.4
func (mr *MockResourceScopeSpanMockRecorder) AddTask(num, prio interface{}) *gomock.Call
AddTask indicates an expected call of AddTask.
func (*MockResourceScopeSpanMockRecorder) BeginSpan ¶ added in v0.2.4
func (mr *MockResourceScopeSpanMockRecorder) BeginSpan() *gomock.Call
BeginSpan indicates an expected call of BeginSpan.
func (*MockResourceScopeSpanMockRecorder) Done ¶ added in v0.2.4
func (mr *MockResourceScopeSpanMockRecorder) Done() *gomock.Call
Done indicates an expected call of Done.
func (*MockResourceScopeSpanMockRecorder) Name ¶ added in v0.2.4
func (mr *MockResourceScopeSpanMockRecorder) Name() *gomock.Call
Name indicates an expected call of Name.
func (*MockResourceScopeSpanMockRecorder) Release ¶ added in v0.2.4
func (mr *MockResourceScopeSpanMockRecorder) Release() *gomock.Call
Release indicates an expected call of Release.
func (*MockResourceScopeSpanMockRecorder) ReleaseMemory ¶ added in v0.2.4
func (mr *MockResourceScopeSpanMockRecorder) ReleaseMemory(size interface{}) *gomock.Call
ReleaseMemory indicates an expected call of ReleaseMemory.
func (*MockResourceScopeSpanMockRecorder) RemainingResource ¶ added in v0.2.4
func (mr *MockResourceScopeSpanMockRecorder) RemainingResource() *gomock.Call
RemainingResource indicates an expected call of RemainingResource.
func (*MockResourceScopeSpanMockRecorder) RemoveConn ¶ added in v0.2.4
func (mr *MockResourceScopeSpanMockRecorder) RemoveConn(dir interface{}) *gomock.Call
RemoveConn indicates an expected call of RemoveConn.
func (*MockResourceScopeSpanMockRecorder) RemoveTask ¶ added in v0.2.4
func (mr *MockResourceScopeSpanMockRecorder) RemoveTask(num, prio interface{}) *gomock.Call
RemoveTask indicates an expected call of RemoveTask.
func (*MockResourceScopeSpanMockRecorder) ReserveMemory ¶ added in v0.2.4
func (mr *MockResourceScopeSpanMockRecorder) ReserveMemory(size, prio interface{}) *gomock.Call
ReserveMemory indicates an expected call of ReserveMemory.
func (*MockResourceScopeSpanMockRecorder) ReserveResources ¶ added in v0.2.4
func (mr *MockResourceScopeSpanMockRecorder) ReserveResources(st interface{}) *gomock.Call
ReserveResources indicates an expected call of ReserveResources.
func (*MockResourceScopeSpanMockRecorder) Stat ¶ added in v0.2.4
func (mr *MockResourceScopeSpanMockRecorder) Stat() *gomock.Call
Stat indicates an expected call of Stat.
type MockResourceScopeViewer ¶ added in v0.2.4
type MockResourceScopeViewer struct {
// contains filtered or unexported fields
}
MockResourceScopeViewer is a mock of ResourceScopeViewer interface.
func NewMockResourceScopeViewer ¶ added in v0.2.4
func NewMockResourceScopeViewer(ctrl *gomock.Controller) *MockResourceScopeViewer
NewMockResourceScopeViewer creates a new mock instance.
func (*MockResourceScopeViewer) EXPECT ¶ added in v0.2.4
func (m *MockResourceScopeViewer) EXPECT() *MockResourceScopeViewerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockResourceScopeViewer) ServiceState ¶ added in v0.2.4
func (m *MockResourceScopeViewer) ServiceState(arg0 string) string
ServiceState mocks base method.
func (*MockResourceScopeViewer) SystemState ¶ added in v0.2.4
func (m *MockResourceScopeViewer) SystemState() string
SystemState mocks base method.
func (*MockResourceScopeViewer) TransientState ¶ added in v0.2.4
func (m *MockResourceScopeViewer) TransientState() string
TransientState mocks base method.
func (*MockResourceScopeViewer) ViewService ¶ added in v0.2.4
func (m *MockResourceScopeViewer) ViewService(arg0 string, arg1 func(ResourceScope) error) error
ViewService mocks base method.
func (*MockResourceScopeViewer) ViewSystem ¶ added in v0.2.4
func (m *MockResourceScopeViewer) ViewSystem(arg0 func(ResourceScope) error) error
ViewSystem mocks base method.
func (*MockResourceScopeViewer) ViewTransient ¶ added in v0.2.4
func (m *MockResourceScopeViewer) ViewTransient(arg0 func(ResourceScope) error) error
ViewTransient mocks base method.
type MockResourceScopeViewerMockRecorder ¶ added in v0.2.4
type MockResourceScopeViewerMockRecorder struct {
// contains filtered or unexported fields
}
MockResourceScopeViewerMockRecorder is the mock recorder for MockResourceScopeViewer.
func (*MockResourceScopeViewerMockRecorder) ServiceState ¶ added in v0.2.4
func (mr *MockResourceScopeViewerMockRecorder) ServiceState(arg0 interface{}) *gomock.Call
ServiceState indicates an expected call of ServiceState.
func (*MockResourceScopeViewerMockRecorder) SystemState ¶ added in v0.2.4
func (mr *MockResourceScopeViewerMockRecorder) SystemState() *gomock.Call
SystemState indicates an expected call of SystemState.
func (*MockResourceScopeViewerMockRecorder) TransientState ¶ added in v0.2.4
func (mr *MockResourceScopeViewerMockRecorder) TransientState() *gomock.Call
TransientState indicates an expected call of TransientState.
func (*MockResourceScopeViewerMockRecorder) ViewService ¶ added in v0.2.4
func (mr *MockResourceScopeViewerMockRecorder) ViewService(arg0, arg1 interface{}) *gomock.Call
ViewService indicates an expected call of ViewService.
func (*MockResourceScopeViewerMockRecorder) ViewSystem ¶ added in v0.2.4
func (mr *MockResourceScopeViewerMockRecorder) ViewSystem(arg0 interface{}) *gomock.Call
ViewSystem indicates an expected call of ViewSystem.
func (*MockResourceScopeViewerMockRecorder) ViewTransient ¶ added in v0.2.4
func (mr *MockResourceScopeViewerMockRecorder) ViewTransient(arg0 interface{}) *gomock.Call
ViewTransient indicates an expected call of ViewTransient.
type NullLimit ¶
type NullLimit struct{}
NullLimit is a stub for tests and initialization of default values
func (*NullLimit) GetConnLimit ¶
func (*NullLimit) GetConnTotalLimit ¶
func (*NullLimit) GetFDLimit ¶
func (*NullLimit) GetMemoryLimit ¶
func (*NullLimit) GetServiceLimits ¶
func (*NullLimit) GetSystemLimits ¶
func (*NullLimit) GetTaskLimit ¶
func (n *NullLimit) GetTaskLimit(ReserveTaskPriority) int
func (*NullLimit) GetTaskTotalLimit ¶
func (*NullLimit) GetTransientLimits ¶
type NullResourceManager ¶
type NullResourceManager struct{}
NullResourceManager is a stub for tests and initialization of default values
func (*NullResourceManager) Close ¶
func (n *NullResourceManager) Close() error
func (*NullResourceManager) OpenService ¶
func (n *NullResourceManager) OpenService(svc string) (ResourceScope, error)
func (*NullResourceManager) ServiceLimitString ¶
func (n *NullResourceManager) ServiceLimitString(string, func(ResourceScope) string) string
func (*NullResourceManager) ServiceState ¶
func (n *NullResourceManager) ServiceState(string) string
func (*NullResourceManager) SystemLimitString ¶
func (n *NullResourceManager) SystemLimitString(func(ResourceScope) string) string
func (*NullResourceManager) SystemState ¶
func (n *NullResourceManager) SystemState() string
func (*NullResourceManager) TransientLimitString ¶
func (n *NullResourceManager) TransientLimitString(func(ResourceScope) string) string
func (*NullResourceManager) TransientState ¶
func (n *NullResourceManager) TransientState() string
func (*NullResourceManager) ViewService ¶
func (n *NullResourceManager) ViewService(svc string, f func(ResourceScope) error) error
func (*NullResourceManager) ViewSystem ¶
func (n *NullResourceManager) ViewSystem(f func(ResourceScope) error) error
func (*NullResourceManager) ViewTransient ¶
func (n *NullResourceManager) ViewTransient(f func(ResourceScope) error) error
type NullScope ¶
type NullScope struct{}
NullScope is a stub for tests and initialization of default values
func (*NullScope) BeginSpan ¶
func (n *NullScope) BeginSpan() (ResourceScopeSpan, error)
func (*NullScope) ReleaseMemory ¶
func (*NullScope) RemainingResource ¶
func (*NullScope) RemoveConn ¶
func (*NullScope) RemoveTask ¶
func (n *NullScope) RemoveTask(num int, prio ReserveTaskPriority)
func (*NullScope) ReserveResources ¶
type ReserveTaskPriority ¶
type ReserveTaskPriority int
ReserveTaskPriority represents which priority in a reservation of task.
const ( // ReserveTaskPriorityUnknown is the default task priority. ReserveTaskPriorityUnknown ReserveTaskPriority = iota // ReserveTaskPriorityHigh is a task reservation priority that indicates a // reservation consume a high task limit. ReserveTaskPriorityHigh // ReserveTaskPriorityMedium is a task reservation priority that indicates a // reservation consume a medium task limit. ReserveTaskPriorityMedium // ReserveTaskPriorityLow is a task reservation priority that indicates a // reservation consume a low task limit. ReserveTaskPriorityLow )
type ResourceManager ¶
type ResourceManager interface { ResourceScopeViewer // OpenService creates a new Service scope associated with System/Transient Scope // The caller owns the returned scope and is responsible for calling Done in order // to signify the end of the scope's span. OpenService(svc string) (ResourceScope, error) // Close closes the resource manager Close() error }
ResourceManager is the interface to the resource management subsystem. The ResourceManager tracks and accounts for resource usage in the stack, from the internals to the application, and provides a mechanism to limit resource usage according to a user configurable policy.
Resource Management through the ResourceManager is based on the concept of Resource Management Scopes, whereby resource usage is constrained by a DAG of scopes, The following diagram illustrates the structure of the resource constraint DAG: System
+------------> Transient........................+................+ | . . +------------> Service------------------------- . ----------+ . | . | . +---> Connection/Memory/Task--- . ----------+ .
The basic resources accounted by the ResourceManager include memory, connections, file descriptors and task. These account for both space and time used by the stack, as each resource has a direct effect on the system availability and performance.
The module of the resource manager is to restrict resource usage at the time of reservation. When a component of the stack needs to use a resource, it reserves it in the appropriate scope. The resource manager gates the reservation against the scope applicable limits; if the limit is exceeded, then an error is up the component to act accordingly. At the lower levels of the stack, this will normally signal a failure of some sorts, like failing to opening a connection, which will propagate to the programmer. Some components may be able to handle resource reservation failure more gracefully. All resources reserved in some scopes are released when the scope is closed. For low level scopes, mainly Service and Connection scopes, this happens when the service or connection is closed.
Service programmers will typically use the resource manager to reserve memory for their subsystem. This happens with two avenues: the programmer can attach a connection to a service, whereby resources reserved by the connection are automatically accounted in the service budget; or the programmer may directly interact with the service scope, by using ViewService through the resource manager interface.
Application programmers can also directly reserve memory in some applicable scope. In order to facilitate control flow delimited resource accounting, all scopes defined in the system allow for the user to create spans. Spans are temporary scopes rooted at some other scope and release their resources when the programmer is done with them. Span scopes can form trees, with nested spans.
Typical Usage:
- Low level components of the system all have access to the resource manager and create connection scopes through it. These scopes are accessible to the user, albeit with a narrower interface, through Conn objects who have a Scope method.
- Services typically center around connections, where the programmer can attach connections to a particular service. They can also directly reserve memory for a service by accessing the service scope using the ResourceManager interface.
- Applications that want to account for their resource usage can reserve memory, typically using a span, directly in the System or a Service scope.
type ResourceScope ¶
type ResourceScope interface { // ReserveMemory reserves memory/buffer space in the scope; the unit is bytes. // // If ReserveMemory returns an error, then no memory was reserved and the caller // should handle the failure condition. // // The priority argument indicates the priority of the memory reservation. A reservation // will fail if the available memory is less than (1+prio)/256 of the scope limit, providing // a mechanism to gracefully handle optional reservations that might overload the system. // // There are 4 predefined priority levels, Low, Medium, High and Always, capturing common // patterns, but the user is free to use any granularity applicable to his case. ReserveMemory(size int64, prio uint8) error // ReleaseMemory explicitly releases memory previously reserved with ReserveMemory ReleaseMemory(size int64) // AddTask reserves task by ReserveTaskPriority in the scope. // // If ReserveTask returns an error, then no task quota was reserved and the caller // should handle the failure condition. AddTask(num int, prio ReserveTaskPriority) error // RemoveTask explicitly releases task reserved with AddTask. RemoveTask(num int, prio ReserveTaskPriority) // AddConn reserves connection by Direction in the scope. AddConn(dir Direction) error // RemoveConn explicitly releases connection reserved with AddConn. RemoveConn(dir Direction) // ReserveResources reserves the resource by ScopeStat, it will reserve all kinds // of resources atomic ReserveResources(st *ScopeStat) error // RemainingResource returns the remaining resource that have not be reserved RemainingResource() (Limit, error) // Stat retrieves current resource usage for the scope. Stat() ScopeStat // Name returns the name of this scope Name() string // BeginSpan creates a new span scope rooted at this scope BeginSpan() (ResourceScopeSpan, error) // Release resource at this scope Release() }
ResourceScope is the interface for all scopes.
type ResourceScopeSpan ¶
type ResourceScopeSpan interface { ResourceScope // Done ends the span and releases associated resources. Done() }
ResourceScopeSpan is a ResourceScope with a delimited span. Span scopes are control flow delimited and release all their associated resources when the programmer calls Done.
Example:
s, err := someScope.BeginSpan() if err != nil { ... } defer s.Done() if err := s.ReserveMemory(...); err != nil { ... } // ... use memory
type ResourceScopeViewer ¶
type ResourceScopeViewer interface { // ViewSystem views the system-wide resource scope. // The system scope is the top level scope that accounts for global // resource usage at all levels of the system. This scope constrains all // other scopes and institutes global hard limits. ViewSystem(func(ResourceScope) error) error // ViewTransient views the transient (DMZ) resource scope. // The transient scope accounts for resources that are in the process of // full establishment. For instance, a new connection prior to the // handshake does not belong to any service, but it still needs to be // constrained as this opens an avenue for attacks in transient resource // usage. ViewTransient(func(ResourceScope) error) error // ViewService retrieves a service-specific scope. ViewService(string, func(ResourceScope) error) error // SystemState output the system resource scope and limit readable SystemState() string // TransientState output the transient (DMZ) resource scope and limit readable TransientState() string // ServiceState output a service-specific resource scope and limit readable ServiceState(string) string }
ResourceScopeViewer is a mixin interface providing view methods for accessing top level scopes
type ScopeStat ¶
type ScopeStat struct { Memory int64 NumTasksHigh int64 NumTasksMedium int64 NumTasksLow int64 NumConnsInbound int64 NumConnsOutbound int64 NumFD int64 }
ScopeStat is a struct containing resource accounting information.
type Unlimited ¶
type Unlimited struct{}
func (*Unlimited) GetConnLimit ¶
func (*Unlimited) GetConnTotalLimit ¶
func (*Unlimited) GetFDLimit ¶
func (*Unlimited) GetMemoryLimit ¶
func (*Unlimited) GetServiceLimits ¶
func (*Unlimited) GetSystemLimits ¶
func (*Unlimited) GetTaskLimit ¶
func (n *Unlimited) GetTaskLimit(ReserveTaskPriority) int