Documentation ¶
Index ¶
- type Index
- type IndexEntry
- type IndexEntrys
- type IndexManager
- func (m *IndexManager) CleanIndices(filter IndexMatcher) error
- func (m *IndexManager) Client() *elastic.Client
- func (m *IndexManager) Close() error
- func (m *IndexManager) CreateIndex(metric *metrics.Metric) error
- func (m *IndexManager) EmptyIndex() string
- func (m *IndexManager) EnableRollover() bool
- func (m *IndexManager) GetReadIndices(metrics []string, namespaces []string, start, end int64) (list []string)
- func (m *IndexManager) GetWriteFixedIndex(metric *metrics.Metric) string
- func (m *IndexManager) GetWriteIndex(metric *metrics.Metric) (string, bool)
- func (m *IndexManager) IndexPrefix() string
- func (m *IndexManager) IndexType() string
- func (m *IndexManager) MergeIndices(filter IndexMatcher, min string, merge, delete bool) ([]*MergeGroup, interface{}, error)
- func (m *IndexManager) MetricNames() (names []string)
- func (m *IndexManager) RequestTimeout() time.Duration
- func (m *IndexManager) RolloverIndices(filter IndexMatcher) error
- func (m *IndexManager) Start(lock mutex.Mutex) error
- func (m *IndexManager) URLs() string
- func (m *IndexManager) WaitIndicesLoad()
- type IndexMatcher
- type MergeGroup
- type NodeDiskUsage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Index ¶
type Index interface { WaitIndicesLoad() GetReadIndices(metrics []string, namespace []string, start, end int64) []string GetWriteIndex(m *metrics.Metric) (string, bool) GetWriteFixedIndex(m *metrics.Metric) string CreateIndex(m *metrics.Metric) error CleanIndices(filter IndexMatcher) error // 清理匹配且过期的索引数据 RolloverIndices(filter IndexMatcher) error // 滚动匹配的索引 MergeIndices(filter IndexMatcher, min string, merge, delete bool) ([]*MergeGroup, interface{}, error) // 合并匹配的索引 MetricNames() []string EmptyIndex() string IndexPrefix() string IndexType() string RequestTimeout() time.Duration Client() *elastic.Client URLs() string EnableRollover() bool }
Index .
type IndexEntry ¶
type IndexEntry struct { Index string Metric string Namespace string Key string Fixed bool Num int64 MinT time.Time MaxT time.Time DocsCount int DocsDeleted int StoreSize int64 Active bool }
IndexEntry .
type IndexEntrys ¶
type IndexEntrys []*IndexEntry
IndexEntrys .
func (IndexEntrys) Len ¶
func (entrys IndexEntrys) Len() int
func (IndexEntrys) Less ¶
func (entrys IndexEntrys) Less(i, j int) bool
func (IndexEntrys) Swap ¶
func (entrys IndexEntrys) Swap(i, j int)
type IndexManager ¶
type IndexManager struct {
// contains filtered or unexported fields
}
IndexManager loading indexes, managing index creation, scrolling, etc
func NewIndexManager ¶
func NewIndexManager(cfg *config, es *elastic.Client, urls string, db *gorm.DB, log logs.Logger) *IndexManager
NewIndexManager .
func (*IndexManager) CleanIndices ¶
func (m *IndexManager) CleanIndices(filter IndexMatcher) error
CleanIndices .
func (*IndexManager) CreateIndex ¶
func (m *IndexManager) CreateIndex(metric *metrics.Metric) error
CreateIndex .
func (*IndexManager) GetReadIndices ¶
func (m *IndexManager) GetReadIndices(metrics []string, namespaces []string, start, end int64) (list []string)
GetReadIndices clusters as namespaces, start、end is ms
func (*IndexManager) GetWriteFixedIndex ¶
func (m *IndexManager) GetWriteFixedIndex(metric *metrics.Metric) string
GetWriteFixedIndex spot-<metric>-<namespace> Gets a time-free index, which represents permanent storage of data
func (*IndexManager) GetWriteIndex ¶
func (m *IndexManager) GetWriteIndex(metric *metrics.Metric) (string, bool)
GetWriteIndex . enable rollover: spot-<metric>-<namespace>-r-000001 spot-<metric>-<namespace>.<key>-r-000001 unable rollover: spot-<metric>-<namespace>-<timestamp> spot-<metric>-<namespace>.<key>-<timestamp>
func (*IndexManager) MergeIndices ¶
func (m *IndexManager) MergeIndices(filter IndexMatcher, min string, merge, delete bool) ([]*MergeGroup, interface{}, error)
MergeIndices .
func (*IndexManager) MetricNames ¶
func (m *IndexManager) MetricNames() (names []string)
MetricNames .
func (*IndexManager) RequestTimeout ¶
func (m *IndexManager) RequestTimeout() time.Duration
RequestTimeout .
func (*IndexManager) RolloverIndices ¶
func (m *IndexManager) RolloverIndices(filter IndexMatcher) error
RolloverIndices .
type MergeGroup ¶
type MergeGroup struct { List []*IndexEntry Indices string MergedSize string MergedDocs int MergedIndex string // contains filtered or unexported fields }
MergeGroup .
type NodeDiskUsage ¶
type NodeDiskUsage struct { ID string Total int64 // Total disk capacity of the node Used int64 // The node is already using disk capacity Store int64 // Index storage UsedPercent float64 // The node is already using a percentage StorePercent float64 // Index storage percentage ExpectDelete int64 // Storage expected to be cleared Deleted int64 // The amount of memory currently cleared }
NodeDiskUsage .
Click to show internal directories.
Click to hide internal directories.