Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BytesPerSec ¶
type FakeATS ¶
func (FakeATS) MarshalJSON ¶
type FakeProcLoadAvg ¶
type FakeProcLoadAvg struct { CPU1m float64 CPU5m float64 CPU10m float64 RunningProcs int TotalProcs int LastPIDUsed int }
func (FakeProcLoadAvg) MarshalJSON ¶
func (p FakeProcLoadAvg) MarshalJSON() ([]byte, error)
type FakeProcNetDev ¶
type FakeProcNetDev struct { Interface string RcvBytes uint64 RcvPackets uint64 RcvErrs uint64 RcvDropped uint64 RcvFIFOErrs uint64 RcvFrameErrs uint64 RcvCompressed uint64 RcvMulticast uint64 SndBytes uint64 SndPackets uint64 SndErrs uint64 SndDropped uint64 SndFIFOErrs uint64 SndCollisions uint64 SndCarrierErrs uint64 SndCompressed uint64 }
func (FakeProcNetDev) MarshalJSON ¶
func (p FakeProcNetDev) MarshalJSON() ([]byte, error)
type FakeServerData ¶
type FakeServerData struct { ATS FakeATS `json:"ats"` System FakeSystem `json:"system"` }
func (*FakeServerData) GetSystem ¶
func (s *FakeServerData) GetSystem() FakeServerSystem
GetSystem returns a FakeServerSystem, which can be serialized as the JSON response of Astats with an "application=system" query
type FakeServerSystem ¶
type FakeServerSystem struct { ATS FakeSystemATS `json:"ats"` System FakeSystem `json:"system"` }
type FakeSystem ¶
type FakeSystem struct { Name string `json:"inf.name"` Speed int `json:"inf.speed"` ProcNetDev FakeProcNetDev `json:"proc.net.dev"` ProcLoadAvg FakeProcLoadAvg `json:"proc.loadavg"` ConfgiReloadRequests uint64 `json:"configReloadRequests"` LastReloadRequest uint64 `json:"lastReloadRequest"` ConfigReloads uint64 `json:"configReloads"` LastReload uint64 `json:"lastReload"` AstatsLoad uint64 `json:"astatsLoad"` Something string `json:"something"` }
type FakeSystemATS ¶
type FakeSystemATS struct {
Server string `json:"server"`
}
type Ths ¶
type Ths struct {
// contains filtered or unexported fields
}
Ths provides threadsafe access to a ThsT pointer. Note the object itself is not safe for multiple access, and must not be mutated, either by the original owner after calling Set, or by future users who call Get. If you need to mutate, perform a deep copy.
func Run ¶
func Run(s FakeServerData, remapIncrements map[string]BytesPerSec) (Ths, error)
Run takes a FakeServerData and a config, and starts running it, incrementing stats per the config. Returns a Threadsafe accessor to the running FakeServerData pointer, whose value may be accessed, but MUST NOT be modified. TODO add increments for Rcv,SndPackets, ProcLoadAvg variance, ConfigReloads
type ThsT ¶
type ThsT *FakeServerData