Skip to content

Commit

Permalink
*: support pyroscope
Browse files Browse the repository at this point in the history
Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
  • Loading branch information
hawkingrei committed Mar 27, 2024
1 parent 4c89996 commit 00099f1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -750,8 +750,8 @@ type Performance struct {
// of init stats the optimizer may make bad decisions due to pseudo stats.
ForceInitStats bool `toml:"force-init-stats" json:"force-init-stats"`

// ConcurrencyInitStats indicates whether to use concurrency to init stats.
ConcurrencyInitStats bool `toml:"concurrency-init-stats" json:"concurrency-init-stats"`
// ConcurrentlyInitStats indicates whether to use concurrency to init stats.
ConcurrentlyInitStats bool `toml:"concurrently-init-stats" json:"concurrently-init-stats"`
}

// PlanCache is the PlanCache section of the config.
Expand Down Expand Up @@ -1019,7 +1019,7 @@ var defaultConf = Config{
EnableLoadFMSketch: false,
LiteInitStats: true,
ForceInitStats: true,
ConcurrencyInitStats: true,
ConcurrentlyInitStats: true,
},
ProxyProtocol: ProxyProtocol{
Networks: "",
Expand Down
10 changes: 5 additions & 5 deletions pkg/statistics/handle/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func (h *Handle) initStatsMeta(is infoschema.InfoSchema) (statstypes.StatsCache,
if err != nil {
return nil, err
}
if config.GetGlobalConfig().Performance.ConcurrencyInitStats {
if config.GetGlobalConfig().Performance.ConcurrentlyInitStats {
ls := initstats.NewWorker(rc.Next, h.initStatsMeta4Chunk)
ls.LoadStats(is, tables, rc)
ls.Wait()
Expand Down Expand Up @@ -242,7 +242,7 @@ func (h *Handle) initStatsHistogramsLite(is infoschema.InfoSchema, cache statsty
return errors.Trace(err)
}
defer terror.Call(rc.Close)
if config.GetGlobalConfig().Performance.ConcurrencyInitStats {
if config.GetGlobalConfig().Performance.ConcurrentlyInitStats {
ls := initstats.NewWorker(rc.Next, h.initStatsHistograms4ChunkLite)
ls.LoadStats(is, cache, rc)
ls.Wait()
Expand Down Expand Up @@ -271,7 +271,7 @@ func (h *Handle) initStatsHistograms(is infoschema.InfoSchema, cache statstypes.
return errors.Trace(err)
}
defer terror.Call(rc.Close)
if config.GetGlobalConfig().Performance.ConcurrencyInitStats {
if config.GetGlobalConfig().Performance.ConcurrentlyInitStats {
ls := initstats.NewWorker(rc.Next, h.initStatsHistograms4Chunk)
ls.LoadStats(is, cache, rc)
ls.Wait()
Expand Down Expand Up @@ -326,7 +326,7 @@ func (h *Handle) initStatsTopN(cache statstypes.StatsCache) error {
return errors.Trace(err)
}
defer terror.Call(rc.Close)
if config.GetGlobalConfig().Performance.ConcurrencyInitStats {
if config.GetGlobalConfig().Performance.ConcurrentlyInitStats {
ls := initstats.NewWorker(rc.Next, func(_ infoschema.InfoSchema, cache statstypes.StatsCache, iter *chunk.Iterator4Chunk) {
h.initStatsTopN4Chunk(cache, iter)
})
Expand Down Expand Up @@ -458,7 +458,7 @@ func (h *Handle) initStatsBuckets(cache statstypes.StatsCache) error {
return errors.Trace(err)
}
defer terror.Call(rc.Close)
if config.GetGlobalConfig().Performance.ConcurrencyInitStats {
if config.GetGlobalConfig().Performance.ConcurrentlyInitStats {
ls := initstats.NewWorker(rc.Next, func(_ infoschema.InfoSchema, cache statstypes.StatsCache, iter *chunk.Iterator4Chunk) {
h.initStatsBuckets4Chunk(cache, iter)
})
Expand Down
12 changes: 6 additions & 6 deletions pkg/statistics/handle/handletest/statstest/stats_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ func TestInitStatsMemTraceWithLite(t *testing.T) {
restore := config.RestoreFunc()
defer restore()
config.UpdateGlobal(func(conf *config.Config) {
conf.Performance.ConcurrencyInitStats = false
conf.Performance.ConcurrentlyInitStats = false
})
testInitStatsMemTraceFunc(t, true)
}
Expand All @@ -199,7 +199,7 @@ func TestInitStatsMemTraceWithoutLite(t *testing.T) {
restore := config.RestoreFunc()
defer restore()
config.UpdateGlobal(func(conf *config.Config) {
conf.Performance.ConcurrencyInitStats = false
conf.Performance.ConcurrentlyInitStats = false
})
testInitStatsMemTraceFunc(t, false)
}
Expand All @@ -208,7 +208,7 @@ func TestInitStatsMemTraceWithConcurrrencyLite(t *testing.T) {
restore := config.RestoreFunc()
defer restore()
config.UpdateGlobal(func(conf *config.Config) {
conf.Performance.ConcurrencyInitStats = true
conf.Performance.ConcurrentlyInitStats = true
})
testInitStatsMemTraceFunc(t, true)
}
Expand All @@ -217,7 +217,7 @@ func TestInitStatsMemTraceWithoutConcurrrencyLite(t *testing.T) {
restore := config.RestoreFunc()
defer restore()
config.UpdateGlobal(func(conf *config.Config) {
conf.Performance.ConcurrencyInitStats = true
conf.Performance.ConcurrentlyInitStats = true
})
testInitStatsMemTraceFunc(t, false)
}
Expand Down Expand Up @@ -315,7 +315,7 @@ func TestInitStatsVer2(t *testing.T) {
defer restore()
config.UpdateGlobal(func(conf *config.Config) {
config.GetGlobalConfig().Performance.LiteInitStats = false
config.GetGlobalConfig().Performance.ConcurrencyInitStats = false
config.GetGlobalConfig().Performance.ConcurrentlyInitStats = false
})
initStatsVer2(t)
}
Expand All @@ -325,7 +325,7 @@ func TestInitStatsVer2Concurrency(t *testing.T) {
defer restore()
config.UpdateGlobal(func(conf *config.Config) {
config.GetGlobalConfig().Performance.LiteInitStats = false
config.GetGlobalConfig().Performance.ConcurrencyInitStats = true
config.GetGlobalConfig().Performance.ConcurrentlyInitStats = true
})
initStatsVer2(t)
}
Expand Down

0 comments on commit 00099f1

Please sign in to comment.