Skip to content

Commit

Permalink
conprof: enable profiling tiflash (#132)
Browse files Browse the repository at this point in the history
close #133
  • Loading branch information
mornyx authored May 17, 2022
1 parent 029a112 commit 64748b8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 11 deletions.
3 changes: 1 addition & 2 deletions component/conprof/http/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,7 @@ func getProfileEstimateSize(component topology.Component) int {
case topology.ComponentTiKV:
return 200 * 1024 // profile size
case topology.ComponentTiFlash:
// TODO: remove this after TiFlash fix the profile bug.
return 0
return 200 * 1024 // profile size
}
return defaultProfileSize
}
Expand Down
6 changes: 1 addition & 5 deletions component/conprof/scrape/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ func (m *Manager) reload(ctx context.Context, oldCfg, newCfg config.ContinueProf
return
}

//start for new component.
// start for new component.
comps = m.getComponentNeedStartScrape(needReload)
for _, comp := range comps {
err := m.startScrape(ctx, comp, newCfg)
Expand All @@ -187,10 +187,6 @@ func (m *Manager) startScrape(ctx context.Context, component topology.Component,
if !continueProfilingCfg.Enable {
return nil
}
// TODO: remove this after TiFlash fix the profile bug.
if component.Name == topology.ComponentTiFlash {
return nil
}
profilingConfig := m.getProfilingConfig(component)
httpCfg := m.config.Security.GetHTTPClientConfig()
addr := fmt.Sprintf("%v:%v", component.IP, component.Port)
Expand Down
5 changes: 1 addition & 4 deletions component/conprof/scrape/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,6 @@ func TestManager(t *testing.T) {
break
}
}
// TODO(crazycs): remove this after support tiflash
require.True(t, list.Target.Component != topology.ComponentTiFlash)
require.True(t, found, fmt.Sprintf("%#v", list))
for _, ts := range list.TsList {
require.True(t, ts >= param.Begin && ts <= param.End)
Expand Down Expand Up @@ -131,8 +129,7 @@ func TestManager(t *testing.T) {

// test for GetCurrentScrapeComponents
comp := manager.GetCurrentScrapeComponents()
// // TODO(crazycs): update this after support tiflash
require.Equal(t, len(comp), len(components)-1)
require.Equal(t, len(comp), len(components))

// test for topology changed.
mockServer2 := testutil.CreateMockProfileServer(t)
Expand Down

0 comments on commit 64748b8

Please sign in to comment.