github.com/matrixorigin/matrixone@v1.2.0/pkg/util/metric/v2/mem.go (about) 1 // Copyright 2023 Matrix Origin 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 package v2 16 17 import ( 18 "github.com/prometheus/client_golang/prometheus" 19 ) 20 21 var ( 22 memMPoolAllocatedSizeGauge = prometheus.NewGaugeVec( 23 prometheus.GaugeOpts{ 24 Namespace: "mo", 25 Subsystem: "mem", 26 Name: "mpool_allocated_size", 27 Help: "Size of mpool have allocated.", 28 }, []string{"type"}) 29 30 MemTAEDefaultAllocatorGauge = memMPoolAllocatedSizeGauge.WithLabelValues("tae_default") 31 MemTAEMutableAllocatorGauge = memMPoolAllocatedSizeGauge.WithLabelValues("tae_mutable") 32 MemTAESmallAllocatorGauge = memMPoolAllocatedSizeGauge.WithLabelValues("tae_small") 33 MemTAEVectorPoolDefaultAllocatorGauge = memMPoolAllocatedSizeGauge.WithLabelValues("vectorpool_default") 34 MemTAELogtailAllocatorGauge = memMPoolAllocatedSizeGauge.WithLabelValues("tae_logtail") 35 MemTAECheckpointAllocatorGauge = memMPoolAllocatedSizeGauge.WithLabelValues("tae_checkpoint") 36 MemTAEMergeAllocatorGauge = memMPoolAllocatedSizeGauge.WithLabelValues("tae_merge") 37 MemTAEWorkSpaceAllocatorGauge = memMPoolAllocatedSizeGauge.WithLabelValues("tae_workspace") 38 MemTAEDebugAllocatorGauge = memMPoolAllocatedSizeGauge.WithLabelValues("tae_debug") 39 MemGlobalStatsAllocatedGauge = memMPoolAllocatedSizeGauge.WithLabelValues("global_stats_allocated") 40 41 memMPoolHighWaterMarkGauge = prometheus.NewGaugeVec( 42 prometheus.GaugeOpts{ 43 Namespace: "mo", 44 Subsystem: "mem", 45 Name: "mpool_high_water_mark_size", 46 Help: "Size of high water mark mp have ever reached", 47 }, []string{"type"}) 48 49 MemTAEDefaultHighWaterMarkGauge = memMPoolHighWaterMarkGauge.WithLabelValues("tae_default_high_water_mark") 50 MemTAEMutableHighWaterMarkGauge = memMPoolHighWaterMarkGauge.WithLabelValues("tae_mutable_high_water_mark") 51 MemTAESmallHighWaterMarkGauge = memMPoolHighWaterMarkGauge.WithLabelValues("tae_small_high_water_mark") 52 MemTAEVectorPoolDefaultHighWaterMarkGauge = memMPoolHighWaterMarkGauge.WithLabelValues("vectorpool_default_high_water_mark") 53 MemTAELogtailHighWaterMarkGauge = memMPoolHighWaterMarkGauge.WithLabelValues("tae_logtail_high_water_mark") 54 MemTAECheckpointHighWaterMarkGauge = memMPoolHighWaterMarkGauge.WithLabelValues("tae_checkpoint_high_water_mark") 55 MemTAEMergeHighWaterMarkGauge = memMPoolHighWaterMarkGauge.WithLabelValues("tae_merge_high_water_mark") 56 MemTAEWorkSpaceHighWaterMarkGauge = memMPoolHighWaterMarkGauge.WithLabelValues("tae_workspace_high_water_mark") 57 MemTAEDebugHighWaterMarkGauge = memMPoolHighWaterMarkGauge.WithLabelValues("tae_debug_high_water_mark") 58 MemGlobalStatsHighWaterMarkGauge = memMPoolHighWaterMarkGauge.WithLabelValues("global_stats_allocated_high_water_mark") 59 ) 60 61 var ( 62 MemTotalCrossPoolFreeCounter = prometheus.NewCounter( 63 prometheus.CounterOpts{ 64 Namespace: "mo", 65 Subsystem: "mem", 66 Name: "cross_pool_free_total", 67 Help: "Total number of cross pool free", 68 }) 69 )