From bd8a7cad7cde41f48b7708e4cd2d39a439e3c94f Mon Sep 17 00:00:00 2001 From: fatkodima Date: Sat, 20 Aug 2022 18:10:52 +0300 Subject: [PATCH] Fix `rake prof:slow_cops` to return correct results --- tasks/prof.rake | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tasks/prof.rake b/tasks/prof.rake index 57e2e1b9043..4c54f6ee809 100644 --- a/tasks/prof.rake +++ b/tasks/prof.rake @@ -24,14 +24,11 @@ namespace :prof do desc 'List the slowest cops' task slow_cops: :run_if_needed do - method = 'RuboCop::Cop::Commissioner#trigger_responding_cops' + method = 'Kernel#public_send' cmd = "stackprof #{dump_path} --text --method '#{method}'" puts cmd output = `#{cmd}` - _header, list, _code = *output - .lines - .grep_v(/RuboCop::Cop::Commissioner/) # ignore internal calls - .slice_after { |line| line.match?(/callees.*:|code:/) } + list = output.lines.grep(/RuboCop::Cop::.+#on_\w+/) puts list.first(40) end