Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Simulator ¶
type Simulator interface { // RegisterStats offers the simulator an opportunity to // register any additional statistics before processing. RegisterStats(*Stats) // Process feeds another heap allocation trace event // into the simulator. Process(goat.Event, *Stats) }
Simulator describes a heap allocation simulator for Go.
type Stats ¶
type Stats struct { // Timestamp is the time in CPU ticks for the most // recent event processed by the simulator. Timestamp uint64 // GCCycles is the number of complete GC cycles that // have passed since the simulator started. GCCycles uint64 // Allocs is the total number of allocations processed by // the simulator. Allocs uint64 // Frees is the total number of frees processed by the // simulator. Frees uint64 // ObjectBytes is the amount of memory in bytes // occupied by live objects. ObjectBytes uint64 // StackBytes is the amount of memory in bytes // occupied by live stacks. StackBytes uint64 // UnusedBytes is the amount of memory in bytes // which is not occupied by live memory, but // that otherwise cannot be used to do so (e.g. fragmentation). UnusedBytes uint64 // FreeBytes is the amount of memory in bytes // which is not occupied by live memory, but that may // be used to do so in the future. FreeBytes uint64 // contains filtered or unexported fields }
Stats is a sample of statistics produced by the simulator.
func NewStats ¶
func NewStats() *Stats
NewStats creates a new valid Stats object.
Must be used instead of constructing a Stats object directly, since there are unexported fields which may need to be initialized.
func (*Stats) AddOther ¶
AddOther adds an amount to the value to a implementation-specific statistic. Panics if the statistic has not been registered.
func (*Stats) GetOther ¶
GetOther returns the value for a implementation-specific statistic by name. Returns 0 if the statistic is not registered.
func (*Stats) OtherStats ¶
OtherStats returns a list of registered implementation-specific statistics.
func (*Stats) RegisterOther ¶
RegisterOther registers a new implementation-specific statistic.
This operation is idempotent and safe to perform again, even after a statistic has been modified.