From 0f298091774dd07521e2d67180eee54cc98f1b0a Mon Sep 17 00:00:00 2001 From: Kentaro Hayashi Date: Wed, 9 Dec 2020 11:26:43 +0900 Subject: [PATCH] Remove unavailable measure mode Since ruby-prof 1.0.0 (2019-07-29), the followings measurement options were removed. * CPU_TIME * GC_TIME * GC_RUNS ref. https://github.com/ruby-prof/ruby-prof/blob/master/CHANGES#L55 --- lib/fluent/rubyprof.rb | 2 +- spec/fluent-rubyprof/rubyprof_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/fluent/rubyprof.rb b/lib/fluent/rubyprof.rb index aaa54e3..bf2dfb3 100644 --- a/lib/fluent/rubyprof.rb +++ b/lib/fluent/rubyprof.rb @@ -69,7 +69,7 @@ def parse_options(argv = ARGV) raise OptionParser::InvalidOption.new("`start` or `stop` must be specified as the 1st argument") end - measure_modes = %w[PROCESS_TIME WALL_TIME CPU_TIME ALLOCATIONS MEMORY GC_RUNS GC_TIME] + measure_modes = %w[PROCESS_TIME WALL_TIME ALLOCATIONS MEMORY] unless measure_modes.include?(opts[:measure_mode]) raise OptionParser::InvalidOption.new("-m allows one of #{measure_modes.join(', ')}") end diff --git a/spec/fluent-rubyprof/rubyprof_spec.rb b/spec/fluent-rubyprof/rubyprof_spec.rb index 1c551c9..6cca617 100644 --- a/spec/fluent-rubyprof/rubyprof_spec.rb +++ b/spec/fluent-rubyprof/rubyprof_spec.rb @@ -13,7 +13,7 @@ end it 'correct measure_mode' do - expect { Fluent::Rubyprof.new.parse_options(['start', '-m', 'CPU_TIME']) }.not_to raise_error + expect { Fluent::Rubyprof.new.parse_options(['start', '-m', 'PROCESS_TIME']) }.not_to raise_error end it 'incorrect measure_mode' do