app/vmstorage: export vm_composite_index_min_timestamp metric

This commit is contained in:
Aliaksandr Valialkin 2021-02-10 16:53:26 +02:00
parent b27288f1b0
commit 08f21d8761
2 changed files with 7 additions and 0 deletions

View File

@ -329,6 +329,9 @@ func registerStorageMetrics(strg *storage.Storage) {
metrics.NewGauge(`vm_index_blocks_with_metric_ids_incorrect_order_total`, func() float64 { metrics.NewGauge(`vm_index_blocks_with_metric_ids_incorrect_order_total`, func() float64 {
return float64(idbm().IndexBlocksWithMetricIDsIncorrectOrder) return float64(idbm().IndexBlocksWithMetricIDsIncorrectOrder)
}) })
metrics.NewGauge(`vm_composite_index_min_timestamp`, func() float64 {
return float64(idbm().MinTimestampForCompositeIndex) / 1e3
})
metrics.NewGauge(`vm_assisted_merges_total{type="storage/small"}`, func() float64 { metrics.NewGauge(`vm_assisted_merges_total{type="storage/small"}`, func() float64 {
return float64(tm().SmallAssistedMerges) return float64(tm().SmallAssistedMerges)

View File

@ -203,6 +203,8 @@ type IndexDBMetrics struct {
IndexBlocksWithMetricIDsProcessed uint64 IndexBlocksWithMetricIDsProcessed uint64
IndexBlocksWithMetricIDsIncorrectOrder uint64 IndexBlocksWithMetricIDsIncorrectOrder uint64
MinTimestampForCompositeIndex uint64
mergeset.TableMetrics mergeset.TableMetrics
} }
@ -244,6 +246,8 @@ func (db *indexDB) UpdateMetrics(m *IndexDBMetrics) {
m.IndexBlocksWithMetricIDsProcessed = atomic.LoadUint64(&indexBlocksWithMetricIDsProcessed) m.IndexBlocksWithMetricIDsProcessed = atomic.LoadUint64(&indexBlocksWithMetricIDsProcessed)
m.IndexBlocksWithMetricIDsIncorrectOrder = atomic.LoadUint64(&indexBlocksWithMetricIDsIncorrectOrder) m.IndexBlocksWithMetricIDsIncorrectOrder = atomic.LoadUint64(&indexBlocksWithMetricIDsIncorrectOrder)
m.MinTimestampForCompositeIndex = uint64(db.minTimestampForCompositeIndex)
db.tb.UpdateMetrics(&m.TableMetrics) db.tb.UpdateMetrics(&m.TableMetrics)
db.doExtDB(func(extDB *indexDB) { db.doExtDB(func(extDB *indexDB) {
extDB.tb.UpdateMetrics(&m.TableMetrics) extDB.tb.UpdateMetrics(&m.TableMetrics)