From 64748b8a1ce484d5596a5ee35abdf3c1735646bc Mon Sep 17 00:00:00 2001 From: Yexiang Zhang Date: Tue, 17 May 2022 11:12:36 +0800 Subject: [PATCH] conprof: enable profiling tiflash (#132) close pingcap/ng-monitoring#133 --- component/conprof/http/api.go | 3 +-- component/conprof/scrape/manager.go | 6 +----- component/conprof/scrape/manager_test.go | 5 +---- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/component/conprof/http/api.go b/component/conprof/http/api.go index 74966fd..4c01a4c 100644 --- a/component/conprof/http/api.go +++ b/component/conprof/http/api.go @@ -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 } diff --git a/component/conprof/scrape/manager.go b/component/conprof/scrape/manager.go index 64d024b..1f8027b 100644 --- a/component/conprof/scrape/manager.go +++ b/component/conprof/scrape/manager.go @@ -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) @@ -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) diff --git a/component/conprof/scrape/manager_test.go b/component/conprof/scrape/manager_test.go index 223b62c..ad7866d 100644 --- a/component/conprof/scrape/manager_test.go +++ b/component/conprof/scrape/manager_test.go @@ -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) @@ -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)