Documentation
¶
Index ¶
- Constants
- Variables
- func CounterNew(key int64, pk string, val *model.TrendItem) interface{}
- func CounterTrendResult(item interface{}) *g.TrendResult
- func CounterUpdate(item interface{}, val *model.TrendItem)
- func GuageNew(key int64, pk string, val *model.TrendItem) interface{}
- func GuageTrendResult(item interface{}) *g.TrendResult
- func GuageUpdate(item interface{}, val *model.TrendItem)
- func Push(items []*model.TrendItem)
- func Start()
- type CacheBigMap
- type CacheHistory
- func (this *CacheHistory) Delete(key int64)
- func (this *CacheHistory) Get(key int64) (*CacheBigMap, bool)
- func (this *CacheHistory) GetItem(key int64, pk string) (interface{}, bool)
- func (this *CacheHistory) Keys() []int64
- func (this *CacheHistory) Len() int
- func (this *CacheHistory) Set(key int64, val *CacheBigMap) *CacheBigMap
- type CounterItem
- type GaugeItem
- type ItemMap
- func (this *ItemMap) BatchDelete(keys []string)
- func (this *ItemMap) Delete(key string)
- func (this *ItemMap) DeleteAll()
- func (this *ItemMap) Flush(key int64)
- func (this *ItemMap) Get(key string) (interface{}, bool)
- func (this *ItemMap) Len() int
- func (this *ItemMap) Set(key string, val interface{})
- func (this *ItemMap) Update(key int64, pk string, val *model.TrendItem)
- type NewFunction
- type ResultFunction
- type UpdateFunction
Constants ¶
View Source
const ( CACHE_HISTORY_MAX_LEN = 5 GET_CACHE_HISTORY_LEN_INTERVAL = time.Duration(60) * time.Second )
View Source
const ( //EXTRACTOR_DEFAULT_SLEEP_TIME = time.Duration(1000) * time.Millisecond //default is 1000ms EXTRACTOR_DEFAULT_HISTORY_INTERVAL = 420 //默认下个时间段map创建超过7分钟,本时间段的数据才可以写入,确保本时间段数据cache完全 )
Variables ¶
View Source
var ( GaugeCacheHistory *CacheHistory CounterCacheHistory *CacheHistory BigMapIndexArray []string AllowMinKey int64 ExtractedKey int64 CacheHistoryIsFull bool )
Functions ¶
func CounterTrendResult ¶
func CounterTrendResult(item interface{}) *g.TrendResult
func CounterUpdate ¶
func GuageTrendResult ¶
func GuageTrendResult(item interface{}) *g.TrendResult
func GuageUpdate ¶
Types ¶
type CacheBigMap ¶
func NewCacheBigMap ¶
func NewCacheBigMap(newF NewFunction, updateF UpdateFunction, resultF ResultFunction) *CacheBigMap
func (*CacheBigMap) Delete ¶
func (this *CacheBigMap) Delete(key string)
func (*CacheBigMap) GetCreateTime ¶
func (this *CacheBigMap) GetCreateTime() int64
type CacheHistory ¶
type CacheHistory struct {
sync.RWMutex
M map[int64]*CacheBigMap
}
func NewCacheHistory ¶
func NewCacheHistory() *CacheHistory
func (*CacheHistory) Delete ¶
func (this *CacheHistory) Delete(key int64)
func (*CacheHistory) Get ¶
func (this *CacheHistory) Get(key int64) (*CacheBigMap, bool)
func (*CacheHistory) GetItem ¶
func (this *CacheHistory) GetItem(key int64, pk string) (interface{}, bool)
func (*CacheHistory) Keys ¶
func (this *CacheHistory) Keys() []int64
func (*CacheHistory) Len ¶
func (this *CacheHistory) Len() int
func (*CacheHistory) Set ¶
func (this *CacheHistory) Set(key int64, val *CacheBigMap) *CacheBigMap
type CounterItem ¶
type CounterItem struct {
sync.RWMutex
Endpoint string
Metric string
Tags string
DsType string
Step int
LastValue float64
LastTime int64
Max float64
Min float64
Sum float64
Num int
}
func (*CounterItem) GetTrendResult ¶
func (this *CounterItem) GetTrendResult() *g.TrendResult
func (*CounterItem) Update ¶
func (this *CounterItem) Update(val *model.TrendItem)
type GaugeItem ¶
type GaugeItem struct {
sync.RWMutex
Endpoint string
Metric string
Tags string
DsType string
Step int
Max float64
Min float64
Sum float64
Num int
}
func (*GaugeItem) GetTrendResult ¶
func (this *GaugeItem) GetTrendResult() *g.TrendResult
type ItemMap ¶
type ItemMap struct {
sync.RWMutex
NewFunc NewFunction
UpdateFunc UpdateFunction
ResultFunc ResultFunction
M map[string]interface{}
}
func NewItemMap ¶
func NewItemMap(newF NewFunction, updateF UpdateFunction, resultF ResultFunction) *ItemMap
func (*ItemMap) BatchDelete ¶
type ResultFunction ¶
type ResultFunction func(item interface{}) *g.TrendResult
type UpdateFunction ¶
Click to show internal directories.
Click to hide internal directories.