oboe 2.3.4.1 → 2.4.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.travis.yml +9 -5
- data/CHANGELOG +12 -0
- data/Gemfile +2 -2
- data/README.md +4 -0
- data/ext/oboe_metal/src/oboe.hpp +18 -12
- data/ext/oboe_metal/src/oboe_wrap.cxx +13 -13
- data/lib/base.rb +23 -0
- data/lib/oboe/api/layerinit.rb +31 -2
- data/lib/oboe/config.rb +10 -14
- data/lib/oboe/frameworks/rails/inst/action_controller.rb +3 -0
- data/lib/oboe/frameworks/rails/inst/connection_adapters/utils.rb +7 -15
- data/lib/oboe/inst/cassandra.rb +76 -108
- data/lib/oboe/inst/dalli.rb +20 -30
- data/lib/oboe/inst/memcache.rb +34 -47
- data/lib/oboe/inst/mongo.rb +9 -7
- data/lib/oboe/inst/moped.rb +145 -177
- data/lib/oboe/inst/rack.rb +6 -2
- data/lib/oboe/inst/resque.rb +1 -0
- data/lib/oboe/version.rb +2 -2
- data/lib/oboe_metal.rb +25 -15
- data/lib/rails/generators/oboe/install_generator.rb +44 -27
- data/lib/rails/generators/oboe/templates/oboe_initializer.rb +10 -0
- data/oboe.gemspec +5 -3
- data/test/instrumentation/cassandra_test.rb +330 -339
- data/test/instrumentation/http_test.rb +13 -13
- data/test/support/config_test.rb +0 -2
- data/test/support/srv1_localset_test.rb +41 -0
- metadata +61 -93
- data/lib/oboe_fu.rb +0 -6
- data/oboe_fu.gemspec +0 -13
checksums.yaml
ADDED
@@ -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
|
data/.travis.yml
CHANGED
@@ -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
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
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
|
-
|
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:
|
data/ext/oboe_metal/src/oboe.hpp
CHANGED
@@ -91,26 +91,32 @@ public:
|
|
91
91
|
}
|
92
92
|
|
93
93
|
/**
|
94
|
-
*
|
94
|
+
* Check if the current request should be traced based on the current settings.
|
95
95
|
*
|
96
|
-
*
|
97
|
-
*
|
98
|
-
*
|
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
|
-
*
|
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
|
-
*
|
104
|
-
*
|
105
|
-
*
|
106
|
-
*
|
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
|
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
|
-
|
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
|
-
|
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 = (
|
2341
|
-
vresult =
|
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;
|
data/lib/base.rb
CHANGED
@@ -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
|
data/lib/oboe/api/layerinit.rb
CHANGED
@@ -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['
|
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
|
|
data/lib/oboe/config.rb
CHANGED
@@ -62,16 +62,9 @@ module Oboe
|
|
62
62
|
@@config[:sanitize_sql] = false
|
63
63
|
|
64
64
|
# The default configuration
|
65
|
-
|
66
|
-
|
67
|
-
|
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
|
14
|
-
#
|
15
|
-
|
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
|
-
#
|
22
|
-
|
23
|
-
|
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
|
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
|
data/lib/oboe/inst/cassandra.rb
CHANGED
@@ -43,41 +43,33 @@ module Oboe
|
|
43
43
|
end
|
44
44
|
|
45
45
|
def insert_with_oboe(column_family, key, hash, options = {})
|
46
|
-
|
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
|
-
|
50
|
-
|
51
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
170
|
-
|
171
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
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
|
-
|
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
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
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
|
-
|
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
|
-
|
251
|
-
|
252
|
-
|
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
|
-
|
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
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
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
|
-
|
273
|
-
|
274
|
-
|
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
|
-
|
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
|