Documentation
¶
Overview ¶
System:Period:[数据类型ID]=数据时间粒度 [时间]:[数据类型ID]:[网元ID]=该网元指标 System:Relation:[ID]=该节点下属所有子节点ID的数组
针对不同的数据类型,采用不同的缓存方式 1、普通不过期缓存,使用Set和Get方法统计处理,三段式Key值 2、定时过期数据,按StoreMinute进行存贮,过期清理
Index ¶
- Constants
- Variables
- func AddRowsToCache(nodeName string, rows *common.DataRows)
- func CloseCache()
- func CountCache() int
- func FormatKey(inKeyType string, inkeyValue interface{}, outKeyName string) string
- func FormatStoreKey(inKeyType string, inkeyValue interface{}) string
- func Get(key string) (interface{}, bool)
- func GetDataRow(dataKey string, timeKey string, id string) (*common.DataRow, bool)
- func Init(cfg *config.Config, rcfg *config.RelationConfig)
- func RedisStatus()
- func Set(key string, value interface{})
- type IdAvailable
- type RedisClient
- type TimeCache
- func (this *TimeCache) Add(rows *common.DataRows)
- func (this *TimeCache) Clean(s time.Duration)
- func (this *TimeCache) Close()
- func (this *TimeCache) ExistsTime(timeKey string) bool
- func (this *TimeCache) Get(timeKey string, id string) (interface{}, bool)
- func (this *TimeCache) Run()
- func (this *TimeCache) Start()
- type TimeCacheItem
Constants ¶
View Source
const (
PoolSize = 4
)
Variables ¶
View Source
var ( // lock sync.RWMutex TimeChanged func(*common.TimeMessage) )
Functions ¶
func CloseCache ¶
func CloseCache()
func CountCache ¶
func CountCache() int
func GetDataRow ¶
取缓存的数据行,如果在内部缓存中没有就到外部缓存找。前提是时间已过期
func RedisStatus ¶
func RedisStatus()
Types ¶
type RedisClient ¶
type RedisClient struct { Redis redis.Client Id string }
func (*RedisClient) Close ¶
func (this *RedisClient) Close()
type TimeCache ¶
type TimeCache struct { Id string KeyName string //数据列字段名 // contains filtered or unexported fields }
func (*TimeCache) ExistsTime ¶
type TimeCacheItem ¶
Click to show internal directories.
Click to hide internal directories.