@@ -818,10 +818,10 @@ type RUDetails struct {
818818 tikvRUV2 * uatomic.Float64
819819 // The following fields preserve TiKV-side RUv2 raw counters that TiDB
820820 // needs for statement-level detail output and TiDB-side RUv2 calculation.
821- resourceManagerReadCnt int64
822- resourceManagerWriteCnt int64
823- tikvStorageProcessedKeysGet int64
824- tikvStorageProcessedKeysBatchGet int64
821+ readRPCCount int64
822+ writeRPCCount int64
823+ getKeysCount int64
824+ batchGetKeysCount int64
825825}
826826
827827// NewRUDetails creates a new RUDetails.
@@ -856,10 +856,10 @@ func (rd *RUDetails) Clone() *RUDetails {
856856 tiflashRU : uatomic .NewFloat64 (rd .tiflashRU .Load ()),
857857 tikvRUV2 : uatomic .NewFloat64 (rd .tikvRUV2 .Load ()),
858858 }
859- atomic .StoreInt64 (& cloned .resourceManagerReadCnt , atomic .LoadInt64 (& rd .resourceManagerReadCnt ))
860- atomic .StoreInt64 (& cloned .resourceManagerWriteCnt , atomic .LoadInt64 (& rd .resourceManagerWriteCnt ))
861- atomic .StoreInt64 (& cloned .tikvStorageProcessedKeysGet , atomic .LoadInt64 (& rd .tikvStorageProcessedKeysGet ))
862- atomic .StoreInt64 (& cloned .tikvStorageProcessedKeysBatchGet , atomic .LoadInt64 (& rd .tikvStorageProcessedKeysBatchGet ))
859+ atomic .StoreInt64 (& cloned .readRPCCount , atomic .LoadInt64 (& rd .readRPCCount ))
860+ atomic .StoreInt64 (& cloned .writeRPCCount , atomic .LoadInt64 (& rd .writeRPCCount ))
861+ atomic .StoreInt64 (& cloned .getKeysCount , atomic .LoadInt64 (& rd .getKeysCount ))
862+ atomic .StoreInt64 (& cloned .batchGetKeysCount , atomic .LoadInt64 (& rd .batchGetKeysCount ))
863863 return cloned
864864}
865865
@@ -870,10 +870,10 @@ func (rd *RUDetails) Merge(other *RUDetails) {
870870 rd .ruWaitDuration .Add (other .ruWaitDuration .Load ())
871871 rd .tiflashRU .Add (other .tiflashRU .Load ())
872872 rd .tikvRUV2 .Add (other .tikvRUV2 .Load ())
873- atomic .AddInt64 (& rd .resourceManagerReadCnt , other .ResourceManagerReadCnt ())
874- atomic .AddInt64 (& rd .resourceManagerWriteCnt , other .ResourceManagerWriteCnt ())
875- atomic .AddInt64 (& rd .tikvStorageProcessedKeysGet , other .TiKVStorageProcessedKeysGet ())
876- atomic .AddInt64 (& rd .tikvStorageProcessedKeysBatchGet , other .TiKVStorageProcessedKeysBatchGet ())
873+ atomic .AddInt64 (& rd .readRPCCount , other .ReadRPCCount ())
874+ atomic .AddInt64 (& rd .writeRPCCount , other .WriteRPCCount ())
875+ atomic .AddInt64 (& rd .getKeysCount , other .GetKeysCount ())
876+ atomic .AddInt64 (& rd .batchGetKeysCount , other .BatchGetKeysCount ())
877877}
878878
879879// String implements fmt.Stringer interface.
@@ -919,68 +919,68 @@ func (rd *RUDetails) AddTiKVRUV2(delta float64) {
919919 rd .tikvRUV2 .Add (delta )
920920}
921921
922- // AddResourceManagerReadCnt records TiKV read RPCs charged to resource management.
923- func (rd * RUDetails ) AddResourceManagerReadCnt (delta int64 ) {
922+ // AddReadRPCCount records TiKV read RPCs charged to resource management.
923+ func (rd * RUDetails ) AddReadRPCCount (delta int64 ) {
924924 if rd == nil || delta == 0 {
925925 return
926926 }
927- atomic .AddInt64 (& rd .resourceManagerReadCnt , delta )
927+ atomic .AddInt64 (& rd .readRPCCount , delta )
928928}
929929
930- // ResourceManagerReadCnt returns TiKV read RPCs charged to resource management.
931- func (rd * RUDetails ) ResourceManagerReadCnt () int64 {
930+ // ReadRPCCount returns TiKV read RPCs charged to resource management.
931+ func (rd * RUDetails ) ReadRPCCount () int64 {
932932 if rd == nil {
933933 return 0
934934 }
935- return atomic .LoadInt64 (& rd .resourceManagerReadCnt )
935+ return atomic .LoadInt64 (& rd .readRPCCount )
936936}
937937
938- // AddResourceManagerWriteCnt records TiKV write RPCs charged to resource management.
939- func (rd * RUDetails ) AddResourceManagerWriteCnt (delta int64 ) {
938+ // AddWriteRPCCount records TiKV write RPCs charged to resource management.
939+ func (rd * RUDetails ) AddWriteRPCCount (delta int64 ) {
940940 if rd == nil || delta == 0 {
941941 return
942942 }
943- atomic .AddInt64 (& rd .resourceManagerWriteCnt , delta )
943+ atomic .AddInt64 (& rd .writeRPCCount , delta )
944944}
945945
946- // ResourceManagerWriteCnt returns TiKV write RPCs charged to resource management.
947- func (rd * RUDetails ) ResourceManagerWriteCnt () int64 {
946+ // WriteRPCCount returns TiKV write RPCs charged to resource management.
947+ func (rd * RUDetails ) WriteRPCCount () int64 {
948948 if rd == nil {
949949 return 0
950950 }
951- return atomic .LoadInt64 (& rd .resourceManagerWriteCnt )
951+ return atomic .LoadInt64 (& rd .writeRPCCount )
952952}
953953
954- // AddTiKVStorageProcessedKeysBatchGet records TiKV batch-get processed keys.
955- func (rd * RUDetails ) AddTiKVStorageProcessedKeysBatchGet (delta int64 ) {
954+ // AddBatchGetKeysCount records TiKV batch-get processed keys.
955+ func (rd * RUDetails ) AddBatchGetKeysCount (delta int64 ) {
956956 if rd == nil || delta == 0 {
957957 return
958958 }
959- atomic .AddInt64 (& rd .tikvStorageProcessedKeysBatchGet , delta )
959+ atomic .AddInt64 (& rd .batchGetKeysCount , delta )
960960}
961961
962- // TiKVStorageProcessedKeysBatchGet returns TiKV batch-get processed keys.
963- func (rd * RUDetails ) TiKVStorageProcessedKeysBatchGet () int64 {
962+ // BatchGetKeysCount returns TiKV batch-get processed keys.
963+ func (rd * RUDetails ) BatchGetKeysCount () int64 {
964964 if rd == nil {
965965 return 0
966966 }
967- return atomic .LoadInt64 (& rd .tikvStorageProcessedKeysBatchGet )
967+ return atomic .LoadInt64 (& rd .batchGetKeysCount )
968968}
969969
970- // AddTiKVStorageProcessedKeysGet records TiKV get processed keys.
971- func (rd * RUDetails ) AddTiKVStorageProcessedKeysGet (delta int64 ) {
970+ // AddGetKeysCount records TiKV get processed keys.
971+ func (rd * RUDetails ) AddGetKeysCount (delta int64 ) {
972972 if rd == nil || delta == 0 {
973973 return
974974 }
975- atomic .AddInt64 (& rd .tikvStorageProcessedKeysGet , delta )
975+ atomic .AddInt64 (& rd .getKeysCount , delta )
976976}
977977
978- // TiKVStorageProcessedKeysGet returns TiKV get processed keys.
979- func (rd * RUDetails ) TiKVStorageProcessedKeysGet () int64 {
978+ // GetKeysCount returns TiKV get processed keys.
979+ func (rd * RUDetails ) GetKeysCount () int64 {
980980 if rd == nil {
981981 return 0
982982 }
983- return atomic .LoadInt64 (& rd .tikvStorageProcessedKeysGet )
983+ return atomic .LoadInt64 (& rd .getKeysCount )
984984}
985985
986986// UpdateTiKVRUV2RawDetails accumulates TiKV-side RUv2 raw counters into RUDetails.
@@ -993,14 +993,14 @@ func UpdateTiKVRUV2RawDetails(ctx context.Context, details *kvrpcpb.ExecDetailsV
993993 return
994994 }
995995
996- ruDetails .AddResourceManagerReadCnt (resourceManagerReadCnt )
997- ruDetails .AddResourceManagerWriteCnt (resourceManagerWriteCnt )
996+ ruDetails .AddReadRPCCount (resourceManagerReadCnt )
997+ ruDetails .AddWriteRPCCount (resourceManagerWriteCnt )
998998 if details == nil || details .RuV2 == nil {
999999 return
10001000 }
10011001 ru := details .RuV2
1002- ruDetails .AddTiKVStorageProcessedKeysBatchGet (int64 (ru .StorageProcessedKeysBatchGet ))
1003- ruDetails .AddTiKVStorageProcessedKeysGet (int64 (ru .StorageProcessedKeysGet ))
1002+ ruDetails .AddBatchGetKeysCount (int64 (ru .StorageProcessedKeysBatchGet ))
1003+ ruDetails .AddGetKeysCount (int64 (ru .StorageProcessedKeysGet ))
10041004}
10051005
10061006// Update updates the RU runtime stats with the given consumption info.
0 commit comments