@@ -879,7 +879,7 @@ func (b *RaftBackend) CollectMetrics(sink *metricsutil.ClusterMetricSink) {
879
879
b .l .RUnlock ()
880
880
881
881
if logStoreStats != nil {
882
- b .collectEtcdBoltMetricsWithStats (* logStoreStats , sink , "logstore" )
882
+ b .collectMetricsWithStats (* logStoreStats , sink , "logstore" )
883
883
}
884
884
885
885
b .collectMetricsWithStats (fsmStats , sink , "fsm" )
@@ -923,29 +923,6 @@ func (b *RaftBackend) collectMetricsWithStats(stats bolt.Stats, sink *metricsuti
923
923
sink .IncrCounterWithLabels ([]string {"raft_storage" , "bolt" , "write" , "time" }, float32 (txstats .GetWriteTime ().Milliseconds ()), labels )
924
924
}
925
925
926
- func (b * RaftBackend ) collectEtcdBoltMetricsWithStats (stats bolt.Stats , sink * metricsutil.ClusterMetricSink , database string ) {
927
- txstats := stats .TxStats
928
- labels := []metricsutil.Label {{"database" , database }}
929
- sink .SetGaugeWithLabels ([]string {"raft_storage" , "bolt" , "freelist" , "free_pages" }, float32 (stats .FreePageN ), labels )
930
- sink .SetGaugeWithLabels ([]string {"raft_storage" , "bolt" , "freelist" , "pending_pages" }, float32 (stats .PendingPageN ), labels )
931
- sink .SetGaugeWithLabels ([]string {"raft_storage" , "bolt" , "freelist" , "allocated_bytes" }, float32 (stats .FreeAlloc ), labels )
932
- sink .SetGaugeWithLabels ([]string {"raft_storage" , "bolt" , "freelist" , "used_bytes" }, float32 (stats .FreelistInuse ), labels )
933
- sink .SetGaugeWithLabels ([]string {"raft_storage" , "bolt" , "transaction" , "started_read_transactions" }, float32 (stats .TxN ), labels )
934
- sink .SetGaugeWithLabels ([]string {"raft_storage" , "bolt" , "transaction" , "currently_open_read_transactions" }, float32 (stats .OpenTxN ), labels )
935
- sink .SetGaugeWithLabels ([]string {"raft_storage" , "bolt" , "page" , "count" }, float32 (txstats .GetPageCount ()), labels )
936
- sink .SetGaugeWithLabels ([]string {"raft_storage" , "bolt" , "page" , "bytes_allocated" }, float32 (txstats .GetPageAlloc ()), labels )
937
- sink .SetGaugeWithLabels ([]string {"raft_storage" , "bolt" , "cursor" , "count" }, float32 (txstats .GetCursorCount ()), labels )
938
- sink .SetGaugeWithLabels ([]string {"raft_storage" , "bolt" , "node" , "count" }, float32 (txstats .GetNodeCount ()), labels )
939
- sink .SetGaugeWithLabels ([]string {"raft_storage" , "bolt" , "node" , "dereferences" }, float32 (txstats .GetNodeDeref ()), labels )
940
- sink .SetGaugeWithLabels ([]string {"raft_storage" , "bolt" , "rebalance" , "count" }, float32 (txstats .GetRebalance ()), labels )
941
- sink .AddSampleWithLabels ([]string {"raft_storage" , "bolt" , "rebalance" , "time" }, float32 (txstats .GetRebalanceTime ().Milliseconds ()), labels )
942
- sink .SetGaugeWithLabels ([]string {"raft_storage" , "bolt" , "split" , "count" }, float32 (txstats .GetSplit ()), labels )
943
- sink .SetGaugeWithLabels ([]string {"raft_storage" , "bolt" , "spill" , "count" }, float32 (txstats .GetSpill ()), labels )
944
- sink .AddSampleWithLabels ([]string {"raft_storage" , "bolt" , "spill" , "time" }, float32 (txstats .GetSpillTime ().Milliseconds ()), labels )
945
- sink .SetGaugeWithLabels ([]string {"raft_storage" , "bolt" , "write" , "count" }, float32 (txstats .GetWrite ()), labels )
946
- sink .IncrCounterWithLabels ([]string {"raft_storage" , "bolt" , "write" , "time" }, float32 (txstats .GetWriteTime ().Milliseconds ()), labels )
947
- }
948
-
949
926
// RaftServer has information about a server in the Raft configuration
950
927
type RaftServer struct {
951
928
// NodeID is the name of the server
0 commit comments