Skip to content

Commit

Permalink
conprof: disable profiling tiflash (#184) (#187)
Browse files Browse the repository at this point in the history
close #185
  • Loading branch information
ti-chi-bot authored Jun 9, 2023
1 parent b99811b commit e43f99c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
3 changes: 2 additions & 1 deletion component/conprof/http/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ func getProfileEstimateSize(component topology.Component) int {
case topology.ComponentTiKV:
return 200 * 1024 // profile size
case topology.ComponentTiFlash:
return 200 * 1024 // profile size
// TODO: remove this after TiFlash fix the profile bug.
return 0
}
return defaultProfileSize
}
Expand Down
4 changes: 4 additions & 0 deletions component/conprof/scrape/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@ 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: 4 additions & 1 deletion component/conprof/scrape/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ func TestManager(t *testing.T) {
break
}
}
// TODO: 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 @@ -130,7 +132,8 @@ func TestManager(t *testing.T) {

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

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

0 comments on commit e43f99c

Please sign in to comment.