Documentation
¶
Overview ¶
Package memorytest provides test doubles for the memory package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FakeReader ¶
type FakeReader struct {
SystemPct float64
SystemPctErr error
RSSBySession map[string]int64
RSSErr error
// contains filtered or unexported fields
}
FakeReader is a test double for memory.Reader that returns configurable values.
func (*FakeReader) GetSessionRSSCalls ¶
func (f *FakeReader) GetSessionRSSCalls() int
GetSessionRSSCalls returns how many times SessionsRSSMB was called (not how many sessions were measured) -- useful for asserting batching behavior.
func (*FakeReader) GetSystemMemoryCalls ¶
func (f *FakeReader) GetSystemMemoryCalls() int
func (*FakeReader) LastRSSNames ¶ added in v1.49.0
func (f *FakeReader) LastRSSNames() []string
LastRSSNames returns the session names passed to the most recent SessionsRSSMB call.
func (*FakeReader) SessionsRSSMB ¶ added in v1.49.0
SessionsRSSMB returns configured RSS values for each requested name. Every call is recorded (count and the requested names) so tests can assert the caller batched sessions into a single call rather than one call per session.
func (*FakeReader) SystemMemoryPct ¶
func (f *FakeReader) SystemMemoryPct() (float64, error)
Click to show internal directories.
Click to hide internal directories.