dataprovider

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 24, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataProvider

type DataProvider interface {
	SaveMemoryInfo(server string, used int, peak int) int64
	SaveInfoCommand(server string, info map[string]string) int64
	SaveMonitorCommand(server, command, argument, keyname, timestamp string) int64
	Close() error
	GetInfo(serverId string) (map[string]interface{}, error)
	GetMemoryInfo(serverId, fromDate, toDate string) ([]map[string]interface{}, error)
	GetCommandStats(serverId, fromDate, toDate, groupBy string) ([]map[string]interface{}, error)
	GetTopCommandsStats(serverId, fromDate, toDate string) ([]map[string]interface{}, error)
	GetTopKeysStats(serverId, fromDate, toDate string) ([]map[string]interface{}, error)
}

func NewProvider

func NewProvider(config *conf.Config) (DataProvider, error)

type SqliteProvide

type SqliteProvide struct {
	// contains filtered or unexported fields
}

func NewSqliteProvide

func NewSqliteProvide(dbPath string) (*SqliteProvide, error)

func (*SqliteProvide) Close

func (sp *SqliteProvide) Close() error

func (*SqliteProvide) GetCommandStats

func (sp *SqliteProvide) GetCommandStats(serverId, fromDate, toDate, groupBy string) ([]map[string]interface{}, error)

func (*SqliteProvide) GetInfo

func (sp *SqliteProvide) GetInfo(serverId string) (map[string]interface{}, error)

func (*SqliteProvide) GetMemoryInfo

func (sp *SqliteProvide) GetMemoryInfo(serverId, fromDate, toDate string) ([]map[string]interface{}, error)

func (*SqliteProvide) GetTopCommandsStats

func (sp *SqliteProvide) GetTopCommandsStats(serverId, fromDate, toDate string) ([]map[string]interface{}, error)

func (*SqliteProvide) GetTopKeysStats

func (sp *SqliteProvide) GetTopKeysStats(serverId, fromDate, toDate string) ([]map[string]interface{}, error)

func (*SqliteProvide) SaveInfoCommand

func (sp *SqliteProvide) SaveInfoCommand(server string, info map[string]string) int64

func (*SqliteProvide) SaveMemoryInfo

func (sp *SqliteProvide) SaveMemoryInfo(server string, used int, peak int) int64

func (*SqliteProvide) SaveMonitorCommand

func (sp *SqliteProvide) SaveMonitorCommand(server, command, keyname, argument, timestamp string) int64

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL