Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pdctl: fix hot store command #1244

Merged
merged 2 commits into from
Sep 12, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions server/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,22 +115,38 @@ func (h *Handler) GetHotReadRegions() *core.StoreHotRegionInfos {

// GetHotBytesWriteStores gets all hot write stores stats.
func (h *Handler) GetHotBytesWriteStores() map[uint64]uint64 {
return h.s.cluster.cachedCluster.getStoresBytesWriteStat()
cluster := h.s.GetRaftCluster()
if cluster == nil {
return nil
}
return cluster.cachedCluster.getStoresBytesWriteStat()
}

// GetHotBytesReadStores gets all hot write stores stats.
func (h *Handler) GetHotBytesReadStores() map[uint64]uint64 {
return h.s.cluster.cachedCluster.getStoresBytesReadStat()
cluster := h.s.GetRaftCluster()
if cluster == nil {
return nil
}
return cluster.cachedCluster.getStoresBytesReadStat()
}

// GetHotKeysWriteStores gets all hot write stores stats.
func (h *Handler) GetHotKeysWriteStores() map[uint64]uint64 {
return h.s.cluster.cachedCluster.getStoresKeysWriteStat()
cluster := h.s.GetRaftCluster()
if cluster == nil {
return nil
}
return cluster.cachedCluster.getStoresKeysWriteStat()
}

// GetHotKeysReadStores gets all hot write stores stats.
func (h *Handler) GetHotKeysReadStores() map[uint64]uint64 {
return h.s.cluster.cachedCluster.getStoresKeysReadStat()
cluster := h.s.GetRaftCluster()
if cluster == nil {
return nil
}
return cluster.cachedCluster.getStoresKeysReadStat()
}

// AddScheduler adds a scheduler.
Expand Down