Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MemStatsStorage ¶
type MemStatsStorage struct {
// contains filtered or unexported fields
}
StatsStorage is where all storage happens for the stats. both the collector (writer) and web (reader) will have access to this. Cant figure out if this needs to be communicated via channels (but cant think of a sensible way of doing that). So they (web, collector) will have direct reference to this. Might revisit that later if I figure it out.
func NewMemStatsStorage ¶
func NewMemStatsStorage(config models.Config) (*MemStatsStorage, error)
NewStatsStorage storage of some sort. Will just be in memory cache for now... need to figure this out more later.
func (*MemStatsStorage) Append ¶
func (mss *MemStatsStorage) Append(stats models.ProcStats) error
Append append data to time list.
func (*MemStatsStorage) GetLastNSeconds ¶
func (mss *MemStatsStorage) GetLastNSeconds(n int) ([]models.ProcStats, error)
GetLastNMinutes...Retrieves the last n seconds from the storage. This means from *now* to *now - n seconds* REALLY inefficient... but will do for now.
type StatsStorage ¶
type StatsStorage interface { // Append stats Append(stats models.ProcStats) error // Retrieves the last n seconds from the storage. // This means from *now* to *now - n seconds* GetLastNSeconds(n int) ([]models.ProcStats, error) }
StatsStorage basically a k/v cache.... until I figure something else out. will regularly serialise the data to disk.
type TableStatsStorage ¶
type TableStatsStorage struct {
// contains filtered or unexported fields
}
TableStatsStorage store against Azure table storage and just serialise the data. makes it non-queryable but that's NOT what I'm after. Also, given the complexity of the structures, I really don't want to create entities for everything.
func NewTableStatsStorage ¶
func NewTableStatsStorage(config models.Config) (*TableStatsStorage, error)
NewStatsStorage storage of some sort. Will just be in memory cache for now... need to figure this out more later.
func (*TableStatsStorage) Append ¶
func (tss *TableStatsStorage) Append(stats models.ProcStats) error
Append data to table storage
func (*TableStatsStorage) GetLastNSeconds ¶
func (tss *TableStatsStorage) GetLastNSeconds(n int) ([]models.ProcStats, error)
GetLastNMinutes...Retrieves the last n seconds from the storage. This means from *now* to *now - n seconds* REALLY inefficient... but will do for now.