Documentation ¶
Index ¶
- Constants
- func AddRecentMetrics(name string, val *model.RecentMetrics) error
- func GetAnomaly(name string) (*model.Anomaly, error)
- func GetHistoricMetric(name string, t time.Time, anom *model.Anomaly) (*model.Metric, error)
- func GetRecentMetrics(name string) (*model.RecentMetrics, error)
- func InitStore(s KVStore)
- func StoreHistoricMetric(name string, m *model.Metric, anom *model.Anomaly) error
- func UpsertAnomay(anom *model.Anomaly) error
- type KVStore
- type SQLite
Constants ¶
View Source
const ANO_PREFIX = "a"
View Source
const HIS_METRIC_PREFIX = "hm"
View Source
const NO_EXPIRE int64 = -1
View Source
const REC_METRIC_PREFIX = "rm"
Variables ¶
This section is empty.
Functions ¶
func AddRecentMetrics ¶
func AddRecentMetrics(name string, val *model.RecentMetrics) error
This method takes care of
func GetHistoricMetric ¶
func GetRecentMetrics ¶
func GetRecentMetrics(name string) (*model.RecentMetrics, error)
func StoreHistoricMetric ¶
StoreHistoricMetric used to store the metric detaiks into a table TODO: Store in DB.
func UpsertAnomay ¶
Types ¶
type KVStore ¶
type KVStore interface { Set(key string, val []byte) error Get(key string) ([]byte, error) ExpirableSet(key string, val []byte, expireAt time.Time) error ExpirableGet(key string) ([]byte, error) // will call the corresponding method to expire the record if store is not // supporting expiry feature. Otherwise Noop. Cleanup() error }
KVStore is an interface which is used to store/fetch the values
type SQLite ¶
type SQLite struct { FilePath string `json:"file_path"` // contains filtered or unexported fields }
SQLite data store config
func (*SQLite) Cleanup ¶
Cleanup is to delete all the values which are expired from store. Implement only if necessary
func (*SQLite) ExpirableGet ¶
ExpirableGet - to get the value from expirable store
func (*SQLite) ExpirableSet ¶
ExpirableSet used to store the value with expiry time
Click to show internal directories.
Click to hide internal directories.