Skip to content

Commit

Permalink
show approximate_kv_size in pd-ctl
Browse files Browse the repository at this point in the history
Signed-off-by: zeminzhou <zhouzemin@pingcap.cn>
  • Loading branch information
zeminzhou committed Jul 16, 2024
1 parent ca179e6 commit 20a8de5
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions pkg/response/region.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,17 +115,18 @@ type RegionInfo struct {
RegionEpoch *metapb.RegionEpoch `json:"epoch,omitempty"`
Peers []MetaPeer `json:"peers,omitempty"`

Leader MetaPeer `json:"leader,omitempty"`
DownPeers []PDPeerStats `json:"down_peers,omitempty"`
PendingPeers []MetaPeer `json:"pending_peers,omitempty"`
CPUUsage uint64 `json:"cpu_usage"`
WrittenBytes uint64 `json:"written_bytes"`
ReadBytes uint64 `json:"read_bytes"`
WrittenKeys uint64 `json:"written_keys"`
ReadKeys uint64 `json:"read_keys"`
ApproximateSize int64 `json:"approximate_size"`
ApproximateKeys int64 `json:"approximate_keys"`
Buckets []string `json:"buckets,omitempty"`
Leader MetaPeer `json:"leader,omitempty"`
DownPeers []PDPeerStats `json:"down_peers,omitempty"`
PendingPeers []MetaPeer `json:"pending_peers,omitempty"`
CPUUsage uint64 `json:"cpu_usage"`
WrittenBytes uint64 `json:"written_bytes"`
ReadBytes uint64 `json:"read_bytes"`
WrittenKeys uint64 `json:"written_keys"`
ReadKeys uint64 `json:"read_keys"`
ApproximateSize int64 `json:"approximate_size"`
ApproximateKeys int64 `json:"approximate_keys"`
ApproximateKvSize int64 `json:"approximate_kv_size"`
Buckets []string `json:"buckets,omitempty"`

ReplicationStatus *ReplicationStatus `json:"replication_status,omitempty"`
}
Expand Down Expand Up @@ -173,6 +174,7 @@ func InitRegion(r *core.RegionInfo, s *RegionInfo) *RegionInfo {
s.ReadKeys = r.GetKeysRead()
s.ApproximateSize = r.GetApproximateSize()
s.ApproximateKeys = r.GetApproximateKeys()
s.ApproximateKvSize = r.GetApproximateKvSize()
s.ReplicationStatus = fromPBReplicationStatus(r.GetReplicationStatus())
s.Buckets = nil

Expand Down

0 comments on commit 20a8de5

Please sign in to comment.