-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding instrumentation core functionality
- Loading branch information
Sohaib Bhatti
committed
May 2, 2013
1 parent
ee6a8b1
commit f4462c2
Showing
4 changed files
with
45 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# Newrelic::Couchbase | ||
|
||
TODO: Write a gem description | ||
CouchBase instrumentation for NewRelic | ||
|
||
## Installation | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
require "newrelic-couchbase/version" | ||
require "newrelic-couchbase/instrumentation" | ||
|
||
=begin | ||
module Newrelic | ||
module Couchbase | ||
# Your code goes here... | ||
end | ||
end | ||
=end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
require 'new_relic/agent/method_tracer' | ||
|
||
DependencyDetection.defer do | ||
@name = :couchbase | ||
|
||
depends_on do | ||
defined?(::Couchbase) && | ||
!::NewRelic::Control.instance['disable_couchbase'] && | ||
!ENV['DISABLE_NEW_RELIC_couchbase'] | ||
end | ||
|
||
executes do | ||
NewRelic::Agent.logger.debug 'Installing CouchBase Instrumentation' | ||
end | ||
|
||
executes do | ||
::Couchbase.module_eval do | ||
class << self | ||
include NewRelic::Agent::MethodTracer | ||
add_method_tracer :connect, 'Couchbase/Bucket/connect' | ||
add_method_tracer :new, 'Couchbase/Bucket/connect' | ||
add_method_tracer :bucket, 'Couchbase/Bucket/bucket' | ||
end | ||
end | ||
|
||
::Couchbase::Bucket.class_eval do | ||
include NewRelic::Agent::MethodTracer | ||
add_method_tracer :set, 'Couchbase/Bucket/set' | ||
add_method_tracer :get, 'Couchbase/Bucket/get' | ||
add_method_tracer :incr, 'Couchbase/Bucket/incr' | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,14 +6,19 @@ require 'newrelic-couchbase/version' | |
Gem::Specification.new do |gem| | ||
gem.name = "newrelic-couchbase" | ||
gem.version = Newrelic::Couchbase::VERSION | ||
gem.authors = ["Sohaib Bhatti"] | ||
gem.authors = ["kurobase"] | ||
gem.email = ["[email protected]"] | ||
gem.description = %q{TODO: Write a gem description} | ||
gem.summary = %q{TODO: Write a gem summary} | ||
gem.description = %q{Couchbase Instrumentation for NewRelic RPM} | ||
gem.summary = %q{Couchbase Instrumentation for NewRelic RPM} | ||
gem.homepage = "" | ||
|
||
gem.files = `git ls-files`.split($/) | ||
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) } | ||
gem.test_files = gem.files.grep(%r{^(test|spec|features)/}) | ||
gem.require_paths = ["lib"] | ||
|
||
gem.add_dependency 'couchbase' | ||
gem.add_dependency 'newrelic_rpm' | ||
|
||
gem.add_development_dependency 'pry' | ||
end |