Documentation ¶
Index ¶
- Constants
- func GetConcurrentOfUpdateIndexAll() int
- func GetCounterFromCache(endpointId int64, counter string) (dsType string, step int, found bool)
- func GetEndpointFromCache(endpoint string) (int64, bool)
- func GetIndexedItemCache(endpoint string, metric string, tags map[string]string, dstype string, ...) (r *cmodel.GraphItem, rerr error)
- func GetTypeAndStep(endpoint string, counter string) (dsType string, step int, found bool)
- func InitCache()
- func ReceiveItem(item *cmodel.GraphItem, md5 string)
- func Start()
- func StartIndexUpdateIncrTask()
- func UpdateIndexAll(updateStepInSec int64)
- func UpdateIndexAllByDefaultStep()
- func UpdateIndexOne(endpoint string, metric string, tags map[string]string, dstype string, ...) error
- type IndexCacheBase
- func (this *IndexCacheBase) ContainsKey(key string) bool
- func (this *IndexCacheBase) Get(key string) interface{}
- func (this *IndexCacheBase) GetMaxSize() int
- func (this *IndexCacheBase) Keys() []string
- func (this *IndexCacheBase) Put(key string, item interface{})
- func (this *IndexCacheBase) Remove(key string)
- func (this *IndexCacheBase) Size() int
- type IndexCacheItem
Constants ¶
View Source
const ( DefaultMaxCacheSize = 5000000 // 默认 最多500w个,太大了内存会耗尽 DefaultCacheProcUpdateTaskSleepInterval = time.Duration(1) * time.Second )
View Source
const ( DefaultUpdateStepInSec = 2 * 24 * 3600 //更新步长,一定不能大于删除步长. 两天内的数据,都可以用来建立索引 ConcurrentOfUpdateIndexAll = 1 )
View Source
const (
IndexUpdateIncrTaskSleepInterval = time.Duration(1) * time.Second // 增量更新间隔时间, 默认30s
)
Variables ¶
This section is empty.
Functions ¶
func GetCounterFromCache ¶
Return DsType Step if Found
func GetEndpointFromCache ¶
Return EndpointId if Found
func GetIndexedItemCache ¶
func GetTypeAndStep ¶
USED WHEN QUERY
func ReceiveItem ¶
index收到一条新上报的监控数据,尝试用于增量更新索引
func UpdateIndexAll ¶
func UpdateIndexAll(updateStepInSec int64)
Types ¶
type IndexCacheBase ¶
索引缓存-基本缓存容器
func NewIndexCacheBase ¶
func NewIndexCacheBase(max int) *IndexCacheBase
func (*IndexCacheBase) ContainsKey ¶
func (this *IndexCacheBase) ContainsKey(key string) bool
func (*IndexCacheBase) Get ¶
func (this *IndexCacheBase) Get(key string) interface{}
func (*IndexCacheBase) GetMaxSize ¶
func (this *IndexCacheBase) GetMaxSize() int
func (*IndexCacheBase) Keys ¶
func (this *IndexCacheBase) Keys() []string
func (*IndexCacheBase) Put ¶
func (this *IndexCacheBase) Put(key string, item interface{})
func (*IndexCacheBase) Remove ¶
func (this *IndexCacheBase) Remove(key string)
func (*IndexCacheBase) Size ¶
func (this *IndexCacheBase) Size() int
type IndexCacheItem ¶
INDEX CACHE 索引缓存的元素数据结构
func NewIndexCacheItem ¶
func NewIndexCacheItem(uuid string, item *cmodel.GraphItem) *IndexCacheItem
Click to show internal directories.
Click to hide internal directories.