newrelic-couchbase 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +44 -0
- data/Rakefile +1 -0
- data/lib/newrelic-couchbase.rb +2 -0
- data/lib/newrelic-couchbase/instrumentation.rb +19 -0
- data/lib/newrelic-couchbase/instrumentation/bucket.rb +34 -0
- data/lib/newrelic-couchbase/instrumentation/cluster.rb +7 -0
- data/lib/newrelic-couchbase/instrumentation/couchbase.rb +18 -0
- data/lib/newrelic-couchbase/instrumentation/view.rb +14 -0
- data/lib/newrelic-couchbase/version.rb +5 -0
- data/newrelic-couchbase.gemspec +23 -0
- metadata +85 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 4c06a4f9acb50ece6bc81a92aa8b558795ec18f0
|
4
|
+
data.tar.gz: 5046acbdc4f42a0cdc78fcef237202a32668177b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 5f77c8d01cdc9741655782c440a745feac9b690b4cf19f352acaa567de087fa8d0e24126bd8fd9f64f7887b9b9d9093abd6c7b23d07a15f984ffa7b58d801623
|
7
|
+
data.tar.gz: 97a439e0119e90f640ee25a925d07aa041d4dfd5d0a9dd80c55c8a8a917ea84d099dee73e15e399e4713a93be67ea8aee9efbd0d3bcc685aad28eab783544061
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Kurobase, Inc.
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
# Newrelic::Couchbase
|
2
|
+
|
3
|
+
![KuroBase](http://kurobase.wpengine.com/wp-content/uploads/2013/10/kurobase.png)
|
4
|
+
|
5
|
+
CouchBase instrumentation for NewRelic
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Make sure you have installed the [Couchbase Ruby
|
10
|
+
Client](https://github.com/couchbase/couchbase-ruby-client) and [NewRelic
|
11
|
+
RPM](https://github.com/newrelic/rpm)
|
12
|
+
|
13
|
+
Add this line to your application's Gemfile:
|
14
|
+
|
15
|
+
gem 'newrelic-couchbase'
|
16
|
+
|
17
|
+
And then execute:
|
18
|
+
|
19
|
+
$ bundle
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
Core methods of Couchbase will begin to traced by NewRelic. To disable
|
24
|
+
Couchbase instrumentation either the DISABLE_NEW_RELIC_COUCHBASE flag
|
25
|
+
can be set to true
|
26
|
+
```ruby
|
27
|
+
ENV['DISABLE_NEW_RELIC_COUCHBASE'] = true
|
28
|
+
```
|
29
|
+
OR, the following statement can be appended to the newrelic.yml file
|
30
|
+
```yaml
|
31
|
+
disable_couchbase: true
|
32
|
+
```
|
33
|
+
|
34
|
+
## Feedback/Comments
|
35
|
+
|
36
|
+
You can send us Feedback or Comments here: [KuroBase Support](http://support.kurobase.com/)
|
37
|
+
|
38
|
+
## Contributing
|
39
|
+
|
40
|
+
1. Fork it
|
41
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
42
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
43
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
44
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'new_relic/agent/method_tracer'
|
2
|
+
|
3
|
+
DependencyDetection.defer do
|
4
|
+
@name = :couchbase
|
5
|
+
|
6
|
+
depends_on do
|
7
|
+
defined?(::Couchbase) &&
|
8
|
+
!::NewRelic::Control.instance['disable_couchbase'] &&
|
9
|
+
!ENV['DISABLE_NEW_RELIC_COUCHBASE']
|
10
|
+
end
|
11
|
+
|
12
|
+
executes do
|
13
|
+
NewRelic::Agent.logger.debug 'Installing CouchBase Instrumentation'
|
14
|
+
end
|
15
|
+
|
16
|
+
executes do
|
17
|
+
Dir.glob("#{File.dirname(__FILE__)}/instrumentation/*.rb") {|file| require file }
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
::Couchbase::Bucket.class_eval do
|
2
|
+
include NewRelic::Agent::MethodTracer
|
3
|
+
|
4
|
+
# https://code.google.com/p/memcached/wiki/BinaryProtocolRevamped#Introduction
|
5
|
+
[
|
6
|
+
:get,
|
7
|
+
:set,
|
8
|
+
:add,
|
9
|
+
:replace,
|
10
|
+
:delete,
|
11
|
+
:increment,
|
12
|
+
:decrement,
|
13
|
+
:flush,
|
14
|
+
:append,
|
15
|
+
:prepend,
|
16
|
+
:touch,
|
17
|
+
:stats,
|
18
|
+
:run
|
19
|
+
].each do |instruction|
|
20
|
+
add_method_tracer instruction, "Couchbase/Bucket/#{instruction.to_s}"
|
21
|
+
end
|
22
|
+
|
23
|
+
add_method_tracer :incr, "Couchbase/Bucket/increment"
|
24
|
+
add_method_tracer :decr, "Couchbase/Bucket/decrement"
|
25
|
+
|
26
|
+
add_method_tracer :cas, 'Couchbase/Bucket/compare_and_swap'
|
27
|
+
add_method_tracer :compare_and_swap, 'Couchbase/Bucket/compare_and_swap'
|
28
|
+
add_method_tracer :design_docs, 'Couchbase/Bucket/design_docs'
|
29
|
+
add_method_tracer :save_design_doc, 'Couchbase/Bucket/save_design_doc'
|
30
|
+
add_method_tracer :delete_design_doc, 'Couchbase/Bucket/delete_design_doc'
|
31
|
+
add_method_tracer :observe_and_wait, 'Couchbase/Bucket/observe_and_wait'
|
32
|
+
add_method_tracer :create_timer, 'Couchbase/Bucket/create_timer'
|
33
|
+
add_method_tracer :create_periodic_timer, 'Couchbase/Bucket/create_perioidic_timer'
|
34
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
::Couchbase.module_eval do
|
2
|
+
class << self
|
3
|
+
include NewRelic::Agent::MethodTracer
|
4
|
+
|
5
|
+
[
|
6
|
+
:connect,
|
7
|
+
:thread_storage,
|
8
|
+
:verify_connection!,
|
9
|
+
:reset_thread_storage!,
|
10
|
+
:bucket,
|
11
|
+
:bucket=
|
12
|
+
].each do |instruction|
|
13
|
+
add_method_tracer instruction, "Couchbase/Class/#{instruction.to_s}"
|
14
|
+
end
|
15
|
+
|
16
|
+
add_method_tracer :new, 'Couchbase/Class/connect'
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
::Couchbase::View.class_eval do
|
2
|
+
include NewRelic::Agent::MethodTracer
|
3
|
+
|
4
|
+
[
|
5
|
+
:each,
|
6
|
+
:first,
|
7
|
+
:take,
|
8
|
+
:on_error,
|
9
|
+
:fetch,
|
10
|
+
:fetch_all
|
11
|
+
].each do |instruction|
|
12
|
+
add_method_tracer instruction, "Couchbase/View/#{instruction.to_s}"
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'newrelic-couchbase/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |gem|
|
7
|
+
gem.name = "newrelic-couchbase"
|
8
|
+
gem.version = Newrelic::Couchbase::VERSION
|
9
|
+
gem.authors = ["KuroBase Inc."]
|
10
|
+
gem.email = ["support@kurobase.com"]
|
11
|
+
gem.description = %q{Couchbase Instrumentation for NewRelic RPM}
|
12
|
+
gem.summary = %q{Couchbase NewRelic Instrumentation}
|
13
|
+
gem.homepage = "https://github.com/kurobase/newrelic-couchbase"
|
14
|
+
gem.license = "MIT"
|
15
|
+
|
16
|
+
gem.files = `git ls-files`.split($/)
|
17
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
18
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
19
|
+
gem.require_paths = ["lib"]
|
20
|
+
|
21
|
+
gem.add_dependency 'couchbase'
|
22
|
+
gem.add_dependency 'newrelic_rpm'
|
23
|
+
end
|
metadata
ADDED
@@ -0,0 +1,85 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: newrelic-couchbase
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- KuroBase Inc.
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-06-10 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: couchbase
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: newrelic_rpm
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
description: Couchbase Instrumentation for NewRelic RPM
|
42
|
+
email:
|
43
|
+
- support@kurobase.com
|
44
|
+
executables: []
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files: []
|
47
|
+
files:
|
48
|
+
- ".gitignore"
|
49
|
+
- Gemfile
|
50
|
+
- LICENSE.txt
|
51
|
+
- README.md
|
52
|
+
- Rakefile
|
53
|
+
- lib/newrelic-couchbase.rb
|
54
|
+
- lib/newrelic-couchbase/instrumentation.rb
|
55
|
+
- lib/newrelic-couchbase/instrumentation/bucket.rb
|
56
|
+
- lib/newrelic-couchbase/instrumentation/cluster.rb
|
57
|
+
- lib/newrelic-couchbase/instrumentation/couchbase.rb
|
58
|
+
- lib/newrelic-couchbase/instrumentation/view.rb
|
59
|
+
- lib/newrelic-couchbase/version.rb
|
60
|
+
- newrelic-couchbase.gemspec
|
61
|
+
homepage: https://github.com/kurobase/newrelic-couchbase
|
62
|
+
licenses:
|
63
|
+
- MIT
|
64
|
+
metadata: {}
|
65
|
+
post_install_message:
|
66
|
+
rdoc_options: []
|
67
|
+
require_paths:
|
68
|
+
- lib
|
69
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
70
|
+
requirements:
|
71
|
+
- - ">="
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: '0'
|
74
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
75
|
+
requirements:
|
76
|
+
- - ">="
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: '0'
|
79
|
+
requirements: []
|
80
|
+
rubyforge_project:
|
81
|
+
rubygems_version: 2.2.2
|
82
|
+
signing_key:
|
83
|
+
specification_version: 4
|
84
|
+
summary: Couchbase NewRelic Instrumentation
|
85
|
+
test_files: []
|