-
Notifications
You must be signed in to change notification settings - Fork 721
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
*: add metrics for hotspot cache #1027
Conversation
server/schedule/hot_cache.go
Outdated
@@ -68,15 +71,19 @@ func (w *HotSpotCache) CheckWrite(region *core.RegionInfo, stores *core.StoresIn | |||
if hotRegionThreshold < hotWriteRegionMinFlowRate { | |||
hotRegionThreshold = hotWriteRegionMinFlowRate | |||
} | |||
return w.isNeedUpdateStatCache(region, hotRegionThreshold, WriteFlow) | |||
return w.isNeedUpdateStatCache(region, WrittenBytesPerSec, hotRegionThreshold, value, WriteFlow) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need metrics for hotRegionThreshold
?
server/schedule/hot_cache.go
Outdated
value, isExist = w.readFlow.Peek(key) | ||
flowBytes = region.ReadBytes | ||
} | ||
func (w *HotSpotCache) isNeedUpdateStatCache(region *core.RegionInfo, flowBytes uint64, hotRegionThreshold uint64, v *core.RegionStat, kind FlowKind) (bool, *core.RegionStat) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please make a more concrete name for v
hotRegionThreshold = hotWriteRegionMinFlowRate | ||
} | ||
return w.isNeedUpdateStatCache(region, hotRegionThreshold, WriteFlow) | ||
hotRegionThreshold := calculateWriteHotThreshold(stores) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing region.WrittenBytes = WrittenBytesPerSec
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is unnecessary.
0f41c16
to
be57eaf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rest LGTM.
server/schedulers/balance_test.go
Outdated
@@ -986,7 +986,7 @@ func (s *testBalanceHotReadRegionSchedulerSuite) TestBalance(c *C) { | |||
r := tc.RandHotRegionFromStore(2, schedule.ReadFlow) | |||
c.Assert(r, NotNil) | |||
c.Assert(r.GetId(), Equals, uint64(2)) | |||
c.Assert(r.ReadBytes, Equals, uint64(512*1024)) | |||
c.Assert(r.ReadBytes, Equals, uint64(512*1024*schedule.RegionHeartBeatReportInterval)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can remove this line since we don't update r.ReadBytes
any more.
server/schedule/metrics.go
Outdated
@@ -32,9 +32,17 @@ var ( | |||
Help: "Bucketed histogram of processing time (s) of finished operator step.", | |||
Buckets: prometheus.ExponentialBuckets(0.01, 2, 16), | |||
}, []string{"type"}) | |||
hotCacheStatusGauge = prometheus.NewGaugeVec( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add an empty line above this line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* server: skip check a region if there is already a pending operator. (#1029) * pdctl, api, schedule: pdctl supports scatter region. (#1028) * add change log (#1024) * scheduler: hot write scheduler randomly select the balance strategy (#1034) * *: new store region score function for balance (#1014) * core: adjust capacity to fit for more cases (#1035) * check config validation (#1036) * *: add metrics for hotspot cache (#1027) * Refine install instructions. (#1041) These extra steps can help new users who are perhaps not quite so familiar with Go setup and conventions. * *: add change log for 2.0 GA (#1038) * *: add change log for ga. * scheduler: adjust metrics (#1042) * fix parse error of config.toml (#1043) * server: resign pd leader when it is not same as etcd leader. (#1039) * server: fix the valid scheduler was deleted when start coordinator (#1045) * server: fix the valid scheduler was deleted when start coordinator
No description provided.