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

*: add metrics for hotspot cache #1027

Merged
merged 6 commits into from
Apr 25, 2018
Merged

Conversation

nolouch
Copy link
Contributor

@nolouch nolouch commented Apr 16, 2018

No description provided.

@@ -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)
Copy link
Contributor

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?

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) {
Copy link
Member

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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing region.WrittenBytes = WrittenBytesPerSec?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unnecessary.

Copy link
Contributor

@disksing disksing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rest LGTM.

@@ -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))
Copy link
Contributor

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.

@@ -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(
Copy link
Contributor

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.

Copy link
Member

@Connor1996 Connor1996 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@disksing disksing merged commit 51cdcb8 into tikv:master Apr 25, 2018
disksing pushed a commit to oh-my-tidb/pd that referenced this pull request May 7, 2018
disksing added a commit that referenced this pull request May 8, 2018
* 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
@nolouch nolouch deleted the add-hot-metrics branch May 22, 2019 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants