oboe 2.3.4.1 → 2.4.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 33bba2d752d8947638ef9b22ad51e4b5c947e8a8
4
+ data.tar.gz: b4f96bd122d67e99bf6647203b51097c49181e8c
5
+ SHA512:
6
+ metadata.gz: 78319d63f067e929ac9e293be2770b9c820bf853ee713f301169a5d905a69a1d0edb8218288d6fa65cf9de749f9487642ad826974faae49fc06af8c5ca118bb1
7
+ data.tar.gz: a985bb58d63612bc8c93304ae3c3a5ea25e48a27c4a1856a945d3d919a4a3e556f68959d6fd2d0e8062246abe2d2ac51ba7cf3aa409442e0401e75122ab66cea
@@ -7,11 +7,15 @@ rvm:
7
7
  - ree
8
8
 
9
9
  # Attempt Travis/Cassandra fix re: https://github.com/travis-ci/travis-ci/issues/1484
10
+ # Updated Cassandra: https://github.com/travis-ci/travis-ci/issues/1650
10
11
  before_install:
11
- # - sudo sh -c "echo 'JVM_OPTS=\"\${JVM_OPTS} -Djava.net.preferIPv4Stack=false\"' >> /usr/local/cassandra/conf/cassandra-env.sh"
12
- # - echo "127.0.0.1 " `hostname` | sudo tee /etc/hosts
13
- # - sudo service cassandra start
14
- # - sleep 5
12
+ - gem update --system 2.1.11
13
+ - gem --version
14
+ - sudo sh -c "echo 'JVM_OPTS=\"\${JVM_OPTS} -Djava.net.preferIPv4Stack=false\"' >> /usr/local/cassandra/conf/cassandra-env.sh"
15
+ - echo "127.0.0.1 " `hostname` | sudo tee /etc/hosts
16
+ - sudo service cassandra start
17
+
18
+ before_script: sleep 10
15
19
 
16
20
  install:
17
21
  - wget https://www.tracelytics.com/install_tracelytics.sh
@@ -24,5 +28,5 @@ before_script:
24
28
  services:
25
29
  - mongodb
26
30
  - memcached
27
- # - cassandra
31
+ - cassandra
28
32
 
data/CHANGELOG CHANGED
@@ -1,3 +1,15 @@
1
+ # oboe 2.4.0.1 (01/12/13)
2
+
3
+ * Report SampleRate & SampleSource per updated SWIG API
4
+ * Change OboeHeroku __Init Key
5
+ * Remove oboe_fu artifacts
6
+ * CodeClimate Initiated improvements
7
+ * Remove SSL connection requirement from Net::HTTP tests
8
+ * oboe.gemspec doesn't specify Ruby 1.8 json dependency
9
+ * add config to blacklist tracing of actions (thanks @nathantsoi!)
10
+ * Report the application server used
11
+ * Support Oboe::Config.merge! and warn on non-existent (thanks @adamjt!)
12
+
1
13
  # oboe 2.3.4.1 (11/21/13)
2
14
 
3
15
  * Stacks that use a caching system like Varnish could see corrupted traces; fixed.
data/Gemfile CHANGED
@@ -3,13 +3,13 @@ source 'https://rubygems.org'
3
3
  # Import dependencies from oboe.gemspec
4
4
  gemspec :name => 'oboe'
5
5
 
6
- gem 'rake'
7
6
 
8
7
  group :development, :test do
9
8
  gem 'minitest'
10
9
  gem 'minitest-reporters'
11
10
  gem 'rack-test'
12
11
  gem 'appraisal'
12
+ gem 'bson'
13
13
  end
14
14
 
15
15
  group :development do
@@ -17,6 +17,7 @@ group :development do
17
17
  gem 'ruby-debug19', :platform => :mri_19, :require => 'ruby-debug'
18
18
  gem 'debugger', :platform => :mri_20
19
19
  gem 'perftools.rb', :platform => :mri, :require => 'perftools'
20
+ gem 'pry'
20
21
  end
21
22
 
22
23
  # Instrumented gems
@@ -28,5 +29,4 @@ gem 'mongo'
28
29
  gem 'bson_ext' # For Mongo, Yours Truly
29
30
  gem 'moped' unless (RUBY_VERSION =~ /^1.8/) == 0
30
31
  gem 'resque'
31
- gem 'rack-test'
32
32
 
data/README.md CHANGED
@@ -9,6 +9,10 @@ It has the ability to report performance metrics on an array of libraries, datab
9
9
 
10
10
  It requires a [TraceView](http://www.appneta.com/products/traceview/) account to view metrics. Get yours, [it's free](http://www.appneta.com/products/traceview-free-account/).
11
11
 
12
+ [![Gem Version](https://badge.fury.io/rb/oboe.png)](http://badge.fury.io/rb/oboe)
13
+ [![Build Status](https://travis-ci.org/appneta/oboe-ruby.png?branch=master)](https://travis-ci.org/appneta/oboe-ruby)
14
+ [![Code Climate](https://codeclimate.com/github/appneta/oboe-ruby.png)](https://codeclimate.com/github/appneta/oboe-ruby)
15
+
12
16
  # Installation
13
17
 
14
18
  The oboe gem is [available on Rubygems](https://rubygems.org/gems/oboe) and can be installed with:
@@ -91,26 +91,32 @@ public:
91
91
  }
92
92
 
93
93
  /**
94
- * Check if the current request should be sampled based on settings.
94
+ * Check if the current request should be traced based on the current settings.
95
95
  *
96
- * If in_xtrace is empty, then sampling will be considered as a new trace.
97
- * Otherwise sampling will be considered as adding to the current trace.
98
- * Different layers may have special rules.
96
+ * If xtrace is empty, or if it is identified as a foreign (ie. cross customer)
97
+ * trace, then sampling will be considered as a new trace.
98
+ * Otherwise sampling will be considered as adding to the current trace.
99
+ * Different layers may have special rules. Also special rules for AppView
100
+ * Web synthetic traces apply if in_tv_meta is given a non-empty string.
99
101
  *
100
- * If a valid X-TV-Meta identifier is provided and AppView Web sample
101
- * always is enabled then return true independent of the other conditions.
102
+ * This is designed to be called once per layer per request.
102
103
  *
103
- * @param layer Name of the layer being considered for tracing
104
- * @param in_xtrace Incoming X-Trace ID (NULL or empty string if not present)
105
- * @param in_tv_meta AppView Web ID from X-TV-Meta HTTP header or higher layer (NULL or empty string if not present).
106
- * @return True if we should trace; otherwise false.
104
+ * @param layer Name of the layer being considered for tracing
105
+ * @param in_xtrace Incoming X-Trace ID (NULL or empty string if not present)
106
+ * @param in_tv_meta AppView Web ID from X-TV-Meta HTTP header or higher layer (NULL or empty string if not present).
107
+ * @return Zero to not trace; otherwise return the sample rate used in the low order
108
+ * bytes 0 to 2 and the sample source in the higher-order byte 3.
107
109
  */
108
- static bool sampleRequest(
110
+ static int sampleRequest(
109
111
  std::string layer,
110
112
  std::string in_xtrace,
111
113
  std::string in_tv_meta)
112
114
  {
113
- return (oboe_sample_layer(layer.c_str(), in_xtrace.c_str(), in_tv_meta.c_str(), NULL, NULL));
115
+ int sample_rate = 0;
116
+ int sample_source = 0;
117
+ int rc = (oboe_sample_layer(layer.c_str(), in_xtrace.c_str(), in_tv_meta.c_str(), &sample_rate, &sample_source));
118
+
119
+ return (rc == 0 ? 0 : (((sample_source & 0xFF) << 24) | (sample_rate & 0xFFFFFF)));
114
120
  }
115
121
 
116
122
  // returns pointer to current context (from thread-local storage)
@@ -2029,6 +2029,16 @@ SWIG_AsVal_int (VALUE obj, int *val)
2029
2029
  }
2030
2030
 
2031
2031
 
2032
+ #define SWIG_From_long LONG2NUM
2033
+
2034
+
2035
+ SWIGINTERNINLINE VALUE
2036
+ SWIG_From_int (int value)
2037
+ {
2038
+ return SWIG_From_long (value);
2039
+ }
2040
+
2041
+
2032
2042
 
2033
2043
 
2034
2044
 
@@ -2060,16 +2070,6 @@ SWIG_AsVal_double (VALUE obj, double *val)
2060
2070
  return SWIG_TypeError;
2061
2071
  }
2062
2072
 
2063
-
2064
- #define SWIG_From_long LONG2NUM
2065
-
2066
-
2067
- SWIGINTERNINLINE VALUE
2068
- SWIG_From_int (int value)
2069
- {
2070
- return SWIG_From_long (value);
2071
- }
2072
-
2073
2073
  swig_class SwigClassMetadata;
2074
2074
 
2075
2075
  #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
@@ -2304,7 +2304,7 @@ _wrap_Context_sampleRequest(int argc, VALUE *argv, VALUE self) {
2304
2304
  std::string arg1 ;
2305
2305
  std::string arg2 ;
2306
2306
  std::string arg3 ;
2307
- bool result;
2307
+ int result;
2308
2308
  VALUE vresult = Qnil;
2309
2309
 
2310
2310
  if ((argc < 3) || (argc > 3)) {
@@ -2337,8 +2337,8 @@ _wrap_Context_sampleRequest(int argc, VALUE *argv, VALUE self) {
2337
2337
  arg3 = *ptr;
2338
2338
  if (SWIG_IsNewObj(res)) delete ptr;
2339
2339
  }
2340
- result = (bool)Context::sampleRequest(arg1,arg2,arg3);
2341
- vresult = SWIG_From_bool(static_cast< bool >(result));
2340
+ result = (int)Context::sampleRequest(arg1,arg2,arg3);
2341
+ vresult = SWIG_From_int(static_cast< int >(result));
2342
2342
  return vresult;
2343
2343
  fail:
2344
2344
  return Qnil;
@@ -1,9 +1,32 @@
1
1
  # Copyright (c) 2013 AppNeta, Inc.
2
2
  # All rights reserved.
3
+
4
+ # Constants from liboboe
5
+ OBOE_TRACE_NEVER = 0
6
+ OBOE_TRACE_ALWAYS = 1
7
+ OBOE_TRACE_THROUGH = 2
8
+
9
+ OBOE_SAMPLE_RATE_SOURCE_FILE = 1
10
+ OBOE_SAMPLE_RATE_SOURCE_DEFAULT = 2
11
+ OBOE_SAMPLE_RATE_SOURCE_OBOE = 3
12
+ OBOE_SAMPLE_RATE_SOURCE_LAST_OBOE = 4
13
+ OBOE_SAMPLE_RATE_SOURCE_DEFAULT_MISCONFIGURED = 5
14
+ OBOE_SAMPLE_RATE_SOURCE_OBOE_DEFAULT = 6
15
+
16
+ # Masks for bitwise ops
17
+ ZERO_MASK = 0b00000000000000000000000000
18
+
19
+ SAMPLE_RATE_MASK = 0b00111111111111111111111111
20
+ SAMPLE_SOURCE_MASK = 0b11000000000000000000000000
21
+
22
+ ZERO_SAMPLE_RATE_MASK = 0b11000000000000000000000000
23
+ ZERO_SAMPLE_SOURCE_MASK = 0b00111111111111111111111111
3
24
 
4
25
  module OboeBase
5
26
  attr_accessor :reporter
6
27
  attr_accessor :loaded
28
+ attr_accessor :sample_source
29
+ attr_accessor :sample_rate
7
30
 
8
31
  def self.included(cls)
9
32
  self.loaded = true
@@ -15,9 +15,38 @@ module Oboe
15
15
  platform_info['Force'] = true
16
16
  platform_info['Ruby.Platform.Version'] = RUBY_PLATFORM
17
17
  platform_info['Ruby.Version'] = RUBY_VERSION
18
- platform_info['Ruby.Rails.Version'] = ::Rails.version if defined?(::Rails)
19
18
  platform_info['Ruby.Oboe.Version'] = ::Oboe::Version::STRING
20
- platform_info['Ruby.OboeHeroku.Version'] = ::OboeHeroku::Version::STRING if defined?(::OboeHeroku)
19
+ platform_info['RubyHeroku.Oboe.Version'] = ::OboeHeroku::Version::STRING if defined?(::OboeHeroku)
20
+
21
+ # Report the framework in use
22
+ platform_info['Ruby.Rails.Version'] = "Rails-#{::Rails.version}" if defined?(::Rails)
23
+ platform_info['Ruby.Grape.Version'] = "Grape-#{::Grape::VERSION}" if defined?(::Grape)
24
+ platform_info['Ruby.Cramp.Version'] = "Cramp-#{::Cramp::VERSION}" if defined?(::Cramp)
25
+
26
+ if defined?(::Padrino)
27
+ platform_info['Ruby.Padrino.Version'] = "Padrino-#{::Padrino::VERSION}"
28
+ elsif defined?(::Sinatra)
29
+ platform_info['Ruby.Sinatra.Version'] = "Sinatra-#{::Sinatra::VERSION}"
30
+ end
31
+
32
+ # Report the server in use (if possible)
33
+ if defined?(::Unicorn)
34
+ platform_info['Ruby.AppContainer.Version'] = "Unicorn-#{::Unicorn::Const::UNICORN_VERSION}"
35
+ elsif defined?(::Puma)
36
+ platform_info['Ruby.AppContainer.Version'] = "Puma-#{::Puma::Const::PUMA_VERSION} (#{::Puma::Const::CODE_NAME})"
37
+ elsif defined?(::PhusionPassenger)
38
+ platform_info['Ruby.AppContainer.Version'] = "#{::PhusionPassenger::PACKAGE_NAME}-#{::PhusionPassenger::VERSION_STRING}"
39
+ elsif defined?(::Thin)
40
+ platform_info['Ruby.AppContainer.Version'] = "Thin-#{::Thin::VERSION::STRING} (#{::Thin::VERSION::CODENAME})"
41
+ elsif defined?(::Mongrel)
42
+ platform_info['Ruby.AppContainer.Version'] = "Mongrel-#{::Mongrel::Const::MONGREL_VERSION}"
43
+ elsif defined?(::Mongrel2)
44
+ platform_info['Ruby.AppContainer.Version'] = "Mongrel2-#{::Mongrel2::VERSION}"
45
+ elsif defined?(::Trinidad)
46
+ platform_info['Ruby.AppContainer.Version'] = "Trinidad-#{::Trinidad::VERSION}"
47
+ else
48
+ platform_info['Ruby.AppContainer.Version'] = "Unknown"
49
+ end
21
50
  rescue
22
51
  end
23
52
 
@@ -62,16 +62,9 @@ module Oboe
62
62
  @@config[:sanitize_sql] = false
63
63
 
64
64
  # The default configuration
65
- default_config = {
66
- :tracing_mode => "through",
67
- :reporter_host => "127.0.0.1",
68
- :sample_rate => 300000,
69
- :verbose => false
70
- }
71
- update!(default_config)
72
-
73
- # For Initialization, mark this as the default SampleRate
74
- @@config[:sample_source] = 2 # OBOE_SAMPLE_RATE_SOURCE_DEFAULT
65
+ @@config[:tracing_mode] = "through"
66
+ @@config[:reporter_host] = "127.0.0.1"
67
+ @@config[:verbose] = false
75
68
  end
76
69
 
77
70
  def self.update!(data)
@@ -80,6 +73,10 @@ module Oboe
80
73
  end
81
74
  end
82
75
 
76
+ def self.merge!(data)
77
+ self.update!(data)
78
+ end
79
+
83
80
  def self.[](key)
84
81
  @@config[key.to_sym]
85
82
  end
@@ -92,10 +89,6 @@ module Oboe
92
89
  end
93
90
 
94
91
  if key == :sample_rate
95
- # When setting SampleRate, note that it's been manually set
96
- # OBOE_SAMPLE_RATE_SOURCE_FILE == 1
97
- @@config[:sample_source] = 1
98
-
99
92
  unless value.is_a?(Integer) or value.is_a?(Float)
100
93
  raise "oboe :sample_rate must be a number between 1 and 1000000 (1m)"
101
94
  end
@@ -121,6 +114,9 @@ module Oboe
121
114
  if sym.to_s =~ /(.+)=$/
122
115
  self[$1] = args.first
123
116
  else
117
+ unless @@config.has_key?(sym)
118
+ Oboe.logger.warn "[oboe/warn] Unknown method call on Oboe::Config: #{sym}"
119
+ end
124
120
  self[sym]
125
121
  end
126
122
  end
@@ -48,6 +48,9 @@ module Oboe
48
48
  end
49
49
 
50
50
  def process_action_with_oboe(method_name, *args)
51
+ return process_action_without_oboe(method_name, *args) if Oboe::Config[:action_blacklist].present? &&
52
+ Oboe::Config[:action_blacklist][[self.controller_name, self.action_name].join('#')]
53
+
51
54
  report_kvs = {
52
55
  :Controller => self.class.name,
53
56
  :Action => self.action_name,
@@ -10,21 +10,13 @@ module Oboe
10
10
  opts = {}
11
11
 
12
12
  begin
13
- if binds.empty?
14
- # Raw SQL. Sanitize if requested
15
- if Oboe::Config[:sanitize_sql]
16
- opts[:Query] = sql.gsub(/\'[\s\S][^\']*\'/, '?')
17
- else
18
- opts[:Query] = sql.to_s
19
- end
13
+ if Oboe::Config[:sanitize_sql]
14
+ # Sanitize SQL and don't report binds
15
+ opts[:Query] = sql.gsub(/\'[\s\S][^\']*\'/, '?')
20
16
  else
21
- # We have bind parameters. Only report if :sanitize_sql isn't true
22
- unless Oboe::Config[:sanitize_sql]
23
- opts[:Query] = sql.to_s
24
- opts[:QueryArgs] = binds.map { |col, val| type_cast(val, col) }
25
- else
26
- opts[:Query] = sql.gsub(/\'[\s\S][^\']*\'/, '?')
27
- end
17
+ # Report raw SQL and any binds if they exist
18
+ opts[:Query] = sql.to_s
19
+ opts[:QueryArgs] = binds.map { |col, val| type_cast(val, col) } unless binds.empty?
28
20
  end
29
21
 
30
22
  opts[:Name] = name.to_s if name
@@ -39,7 +31,7 @@ module Oboe
39
31
  opts[:Database] = config["database"] if config.has_key?("database")
40
32
  opts[:RemoteHost] = config["host"] if config.has_key?("host")
41
33
  opts[:Flavor] = config["adapter"] if config.has_key?("adapter")
42
- rescue Exception => e
34
+ rescue StandardError => e
43
35
  Oboe.logger.debug "Exception raised capturing ActiveRecord KVs: #{e.inspect}"
44
36
  Oboe.logger.debug e.backtrace.join("\n")
45
37
  end
@@ -43,41 +43,33 @@ module Oboe
43
43
  end
44
44
 
45
45
  def insert_with_oboe(column_family, key, hash, options = {})
46
- if Oboe.tracing?
47
- report_kvs = extract_trace_details(:insert, column_family, key, hash, options)
46
+ return insert_without_oboe(column_family, key, hash, options = {}) unless Oboe.tracing?
48
47
 
49
- Oboe::API.trace('cassandra', report_kvs) do
50
- insert_without_oboe(column_family, key, hash, options = {})
51
- end
52
- else
48
+ report_kvs = extract_trace_details(:insert, column_family, key, hash, options)
49
+
50
+ Oboe::API.trace('cassandra', report_kvs) do
53
51
  insert_without_oboe(column_family, key, hash, options = {})
54
52
  end
55
53
  end
56
54
 
57
55
  def remove_with_oboe(column_family, key, *columns_and_options)
56
+ return send :remove_without_oboe, *args unless Oboe.tracing?
57
+
58
58
  args = [column_family, key] + columns_and_options
59
-
60
- if Oboe.tracing?
61
- report_kvs = extract_trace_details(:remove, column_family, key, columns_and_options)
59
+ report_kvs = extract_trace_details(:remove, column_family, key, columns_and_options)
62
60
 
63
- Oboe::API.trace('cassandra', report_kvs) do
64
- send :remove_without_oboe, *args
65
- end
66
- else
61
+ Oboe::API.trace('cassandra', report_kvs) do
67
62
  send :remove_without_oboe, *args
68
63
  end
69
64
  end
70
65
 
71
66
  def count_columns_with_oboe(column_family, key, *columns_and_options)
67
+ return send :count_columns_without_oboe, *args unless Oboe.tracing?
68
+
72
69
  args = [column_family, key] + columns_and_options
73
-
74
- if Oboe.tracing?
75
- report_kvs = extract_trace_details(:count_columns, column_family, key, columns_and_options)
70
+ report_kvs = extract_trace_details(:count_columns, column_family, key, columns_and_options)
76
71
 
77
- Oboe::API.trace('cassandra', report_kvs) do
78
- send :count_columns_without_oboe, *args
79
- end
80
- else
72
+ Oboe::API.trace('cassandra', report_kvs) do
81
73
  send :count_columns_without_oboe, *args
82
74
  end
83
75
  end
@@ -97,29 +89,23 @@ module Oboe
97
89
  end
98
90
 
99
91
  def multi_get_columns_with_oboe(column_family, key, *columns_and_options)
92
+ return send :multi_get_columns_without_oboe, *args unless Oboe.tracing?
93
+
100
94
  args = [column_family, key] + columns_and_options
101
-
102
- if Oboe.tracing?
103
- report_kvs = extract_trace_details(:multi_get_columns, column_family, key, columns_and_options)
95
+ report_kvs = extract_trace_details(:multi_get_columns, column_family, key, columns_and_options)
104
96
 
105
- Oboe::API.trace('cassandra', report_kvs, :multi_get_columns) do
106
- send :multi_get_columns_without_oboe, *args
107
- end
108
- else
97
+ Oboe::API.trace('cassandra', report_kvs, :multi_get_columns) do
109
98
  send :multi_get_columns_without_oboe, *args
110
99
  end
111
100
  end
112
101
 
113
102
  def get_with_oboe(column_family, key, *columns_and_options)
103
+ return send :get_without_oboe, *args unless Oboe.tracing?
104
+
114
105
  args = [column_family, key] + columns_and_options
115
-
116
- if Oboe.tracing?
117
- report_kvs = extract_trace_details(:get, column_family, key, columns_and_options)
106
+ report_kvs = extract_trace_details(:get, column_family, key, columns_and_options)
118
107
 
119
- Oboe::API.trace('cassandra', report_kvs, :get) do
120
- send :get_without_oboe, *args
121
- end
122
- else
108
+ Oboe::API.trace('cassandra', report_kvs, :get) do
123
109
  send :get_without_oboe, *args
124
110
  end
125
111
  end
@@ -139,15 +125,12 @@ module Oboe
139
125
  end
140
126
 
141
127
  def exists_with_oboe?(column_family, key, *columns_and_options)
128
+ return send :exists_without_oboe?, *args unless Oboe.tracing?
129
+
142
130
  args = [column_family, key] + columns_and_options
143
-
144
- if Oboe.tracing?
145
- report_kvs = extract_trace_details(:exists?, column_family, key, columns_and_options)
131
+ report_kvs = extract_trace_details(:exists?, column_family, key, columns_and_options)
146
132
 
147
- Oboe::API.trace('cassandra', report_kvs) do
148
- send :exists_without_oboe?, *args
149
- end
150
- else
133
+ Oboe::API.trace('cassandra', report_kvs) do
151
134
  send :exists_without_oboe?, *args
152
135
  end
153
136
  end
@@ -166,117 +149,102 @@ module Oboe
166
149
  end
167
150
 
168
151
  def get_range_batch_with_oboe(column_family, options = {})
169
- if Oboe.tracing?
170
- report_kvs = extract_trace_details(:get_range_batch, column_family, nil, nil)
171
- args = [column_family, options]
152
+ return get_range_batch_without_oboe(column_family, options) unless Oboe.tracing?
153
+
154
+ report_kvs = extract_trace_details(:get_range_batch, column_family, nil, nil)
155
+ args = [column_family, options]
172
156
 
173
- Oboe::API.trace('cassandra', report_kvs, :get_range_batch) do
174
- get_range_batch_without_oboe(column_family, options)
175
- end
176
- else
157
+ Oboe::API.trace('cassandra', report_kvs, :get_range_batch) do
177
158
  get_range_batch_without_oboe(column_family, options)
178
159
  end
179
160
  end
180
161
 
181
162
  def get_indexed_slices_with_oboe(column_family, index_clause, *columns_and_options)
163
+ return send :get_indexed_slices_without_oboe, *args unless Oboe.tracing?
164
+
182
165
  args = [column_family, index_clause] + columns_and_options
183
-
184
- if Oboe.tracing?
185
- report_kvs = extract_trace_details(:get_indexed_slices, column_family, nil, columns_and_options)
166
+ report_kvs = extract_trace_details(:get_indexed_slices, column_family, nil, columns_and_options)
186
167
 
187
- Oboe::API.trace('cassandra', report_kvs) do
188
- send :get_indexed_slices_without_oboe, *args
189
- end
190
- else
168
+ Oboe::API.trace('cassandra', report_kvs) do
191
169
  send :get_indexed_slices_without_oboe, *args
192
170
  end
193
171
  end
194
172
 
195
173
  def create_index_with_oboe(keyspace, column_family, column_name, validation_class)
196
- if Oboe.tracing?
197
- report_kvs = extract_trace_details(:create_index, column_family, nil, nil)
198
- begin
199
- report_kvs[:Keyspace] = keyspace.to_s
200
- report_kvs[:Column_name] = column_name.to_s
201
- report_kvs[:Validation_class] = validation_class.to_s
202
- rescue
203
- end
174
+ unless Oboe.tracing?
175
+ return create_index_without_oboe(keyspace, column_family, column_name, validation_class)
176
+ end
177
+
178
+ report_kvs = extract_trace_details(:create_index, column_family, nil, nil)
179
+ begin
180
+ report_kvs[:Keyspace] = keyspace.to_s
181
+ report_kvs[:Column_name] = column_name.to_s
182
+ report_kvs[:Validation_class] = validation_class.to_s
183
+ rescue
184
+ end
204
185
 
205
- Oboe::API.trace('cassandra', report_kvs) do
206
- create_index_without_oboe(keyspace, column_family, column_name, validation_class)
207
- end
208
- else
186
+ Oboe::API.trace('cassandra', report_kvs) do
209
187
  create_index_without_oboe(keyspace, column_family, column_name, validation_class)
210
188
  end
211
189
  end
212
190
 
213
191
  def drop_index_with_oboe(keyspace, column_family, column_name)
214
- if Oboe.tracing?
215
- report_kvs = extract_trace_details(:drop_index, column_family, nil, nil)
216
- begin
217
- report_kvs[:Keyspace] = keyspace.to_s
218
- report_kvs[:Column_name] = column_name.to_s
219
- rescue
220
- end
192
+ return drop_index_without_oboe(keyspace, column_family, column_name) unless Oboe.tracing?
193
+
194
+ report_kvs = extract_trace_details(:drop_index, column_family, nil, nil)
195
+ begin
196
+ report_kvs[:Keyspace] = keyspace.to_s
197
+ report_kvs[:Column_name] = column_name.to_s
198
+ rescue
199
+ end
221
200
 
222
- Oboe::API.trace('cassandra', report_kvs) do
223
- drop_index_without_oboe(keyspace, column_family, column_name)
224
- end
225
- else
201
+ Oboe::API.trace('cassandra', report_kvs) do
226
202
  drop_index_without_oboe(keyspace, column_family, column_name)
227
203
  end
228
204
  end
229
205
 
230
206
  def add_column_family_with_oboe(cf_def)
231
- if Oboe.tracing?
232
- report_kvs = extract_trace_details(:add_column_family, nil, nil, nil)
233
- begin
234
- report_kvs[:Cf] = cf_def[:name] if cf_def.is_a?(Hash) and cf_def.has_key?(:name)
235
- rescue
236
- end
207
+ return add_column_family_without_oboe(cf_def) unless Oboe.tracing?
237
208
 
238
- Oboe::API.trace('cassandra', report_kvs) do
239
- add_column_family_without_oboe(cf_def)
240
- end
241
- else
209
+ report_kvs = extract_trace_details(:add_column_family, nil, nil, nil)
210
+ begin
211
+ report_kvs[:Cf] = cf_def[:name] if cf_def.is_a?(Hash) and cf_def.has_key?(:name)
212
+ rescue
213
+ end
214
+
215
+ Oboe::API.trace('cassandra', report_kvs) do
242
216
  add_column_family_without_oboe(cf_def)
243
217
  end
244
218
  end
245
219
 
246
220
  def drop_column_family_with_oboe(column_family)
247
- if Oboe.tracing?
248
- report_kvs = extract_trace_details(:drop_column_family, column_family, nil, nil)
221
+ return drop_column_family_without_oboe(column_family) unless Oboe.tracing?
249
222
 
250
- Oboe::API.trace('cassandra', report_kvs) do
251
- drop_column_family_without_oboe(column_family)
252
- end
253
- else
223
+ report_kvs = extract_trace_details(:drop_column_family, column_family, nil, nil)
224
+
225
+ Oboe::API.trace('cassandra', report_kvs) do
254
226
  drop_column_family_without_oboe(column_family)
255
227
  end
256
228
  end
257
229
 
258
230
  def add_keyspace_with_oboe(ks_def)
259
- if Oboe.tracing?
260
- report_kvs = extract_trace_details(:add_keyspace, nil, nil, nil)
261
- report_kvs[:Name] = ks_def.name rescue ""
231
+ return add_keyspace_without_oboe(ks_def) unless Oboe.tracing?
262
232
 
263
- Oboe::API.trace('cassandra', report_kvs) do
264
- add_keyspace_without_oboe(ks_def)
265
- end
266
- else
233
+ report_kvs = extract_trace_details(:add_keyspace, nil, nil, nil)
234
+ report_kvs[:Name] = ks_def.name rescue ""
235
+
236
+ Oboe::API.trace('cassandra', report_kvs) do
267
237
  add_keyspace_without_oboe(ks_def)
268
238
  end
269
239
  end
270
240
 
271
241
  def drop_keyspace_with_oboe(keyspace)
272
- if Oboe.tracing?
273
- report_kvs = extract_trace_details(:drop_keyspace, nil, nil, nil)
274
- report_kvs[:Name] = keyspace.to_s rescue ""
242
+ return drop_keyspace_without_oboe(keyspace) unless Oboe.tracing?
243
+
244
+ report_kvs = extract_trace_details(:drop_keyspace, nil, nil, nil)
245
+ report_kvs[:Name] = keyspace.to_s rescue ""
275
246
 
276
- Oboe::API.trace('cassandra', report_kvs) do
277
- drop_keyspace_without_oboe(keyspace)
278
- end
279
- else
247
+ Oboe::API.trace('cassandra', report_kvs) do
280
248
  drop_keyspace_without_oboe(keyspace)
281
249
  end
282
250
  end