Skip to content

Commit eb75b8c

Browse files
authored
conprof: disable profiling tiflash (#184) (#188)
close #185
1 parent 43629a7 commit eb75b8c

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

component/conprof/http/api.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ func getProfileEstimateSize(component topology.Component) int {
117117
case topology.ComponentTiKV:
118118
return 200 * 1024 // profile size
119119
case topology.ComponentTiFlash:
120-
return 200 * 1024 // profile size
120+
// TODO: remove this after TiFlash fix the profile bug.
121+
return 0
121122
}
122123
return defaultProfileSize
123124
}

component/conprof/scrape/manager.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,10 @@ func (m *Manager) startScrape(ctx context.Context, component topology.Component,
187187
if !continueProfilingCfg.Enable {
188188
return nil
189189
}
190+
// TODO: remove this after TiFlash fix the profile bug.
191+
if component.Name == topology.ComponentTiFlash {
192+
return nil
193+
}
190194
profilingConfig := m.getProfilingConfig(component)
191195
httpCfg := m.config.Security.GetHTTPClientConfig()
192196
addr := fmt.Sprintf("%v:%v", component.IP, component.Port)

component/conprof/scrape/manager_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ func TestManager(t *testing.T) {
8989
break
9090
}
9191
}
92+
// TODO: remove this after support tiflash
93+
require.True(t, list.Target.Component != topology.ComponentTiFlash)
9294
require.True(t, found, fmt.Sprintf("%#v", list))
9395
for _, ts := range list.TsList {
9496
require.True(t, ts >= param.Begin && ts <= param.End)
@@ -129,7 +131,8 @@ func TestManager(t *testing.T) {
129131

130132
// test for GetCurrentScrapeComponents
131133
comp := manager.GetCurrentScrapeComponents()
132-
require.Equal(t, len(comp), len(components))
134+
// TODO: update this after support tiflash
135+
require.Equal(t, len(comp), len(components)-1)
133136

134137
// test for topology changed.
135138
mockServer2 := testutil.CreateMockProfileServer(t)

0 commit comments

Comments
 (0)