lib/oboe/config.rb in oboe-2.2.0 vs lib/oboe/config.rb in oboe-2.2.5

- old
+ new

@@ -40,10 +40,15 @@ @@config[:resque][:link_workers] = false # Setup an empty host blacklist (see: Oboe::API::Util.blacklisted?) @@config[:blacklist] = [] + # The oboe Ruby client has the ability to sanitize query literals + # from SQL statements. By default this is disabled. Enable to + # avoid collecting and reporting query literals to TraceView. + @@config[:sanitize_sql] = false + update!(data) # For Initialization, mark this as the default SampleRate @@config[:sample_source] = 2 # OBOE_SAMPLE_RATE_SOURCE_DEFAULT end @@ -63,18 +68,25 @@ if key == :sample_rate # When setting SampleRate, note that it's been manually set # OBOE_SAMPLE_RATE_SOURCE_FILE == 1 @@config[:sample_source] = 1 + + unless value.is_a?(Integer) or value.is_a?(Float) + raise "oboe :sample_rate must be a number between 1 and 1000000 (1m)" + end # Validate :sample_rate value unless value.between?(1, 1e6) raise "oboe :sample_rate must be between 1 and 1000000 (1m)" end + # Assure value is an integer + @@config[key.to_sym] = value.to_i + # Update liboboe with the new SampleRate value - Oboe::Context.setDefaultSampleRate(value) + Oboe::Context.setDefaultSampleRate(value.to_i) end # Update liboboe if updating :tracing_mode if key == :tracing_mode case value.downcase @@ -102,10 +114,10 @@ end config = { :tracing_mode => "through", :reporter_host => "127.0.0.1", - :sample_rate => 1000000, + :sample_rate => 300000, :verbose => false } Oboe::Config.initialize(config)