appsignal 1.0.2.beta.2 → 1.0.2.beta.3
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +2 -0
- data/README.md +7 -0
- data/lib/appsignal/extension.rb +13 -7
- data/lib/appsignal/integrations/mongo_ruby_driver.rb +4 -2
- data/lib/appsignal/version.rb +1 -1
- data/spec/lib/appsignal/extension_spec.rb +25 -4
- data/spec/lib/appsignal/integrations/mongo_ruby_driver_spec.rb +6 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4a01467c85c347db2cbbc1eb55f4524d7b3538dd
|
4
|
+
data.tar.gz: 9f95f2f8bacb616e584576aa3040e4f2bd0965ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ada7231ed4c993cf94202aaab459bfca8fca6e0c4e50fdfcc77ccb8e50204e1e71648d77fed727fcccfdc57c848c925b099865de1892829972e160834911aaee
|
7
|
+
data.tar.gz: 9bbbbf3c540af6645e0cca554d51e0f62e1fc2b3382f63c0a11c8fb22ff12a231b669ff25593bb601b91f03c588a3f1fb583188591be482d48913871783efbc0
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,8 @@
|
|
2
2
|
* Bug fix in format of process memory measurements
|
3
3
|
* Event formatter for `instantiation.active_record`
|
4
4
|
* Rake integration file for backwards compatibility
|
5
|
+
* Don't instrument mongo-ruby-driver when transaction is not present
|
6
|
+
* Accept method calls on extension if it's not loaded
|
5
7
|
|
6
8
|
# 1.0.1
|
7
9
|
* Fix for bug in gem initialization when using `safe_yaml` gem
|
data/README.md
CHANGED
@@ -30,3 +30,10 @@ BUNDLE_GEMFILE=gemfiles/sinatra.gemfile bundle exec rspec
|
|
30
30
|
Or run `rake generate_bundle_and_spec_all` to generate a script that runs specs for all
|
31
31
|
Ruby versions and gem combinations we support.
|
32
32
|
You need Rvm or Rbenv to do this. Travis will run specs for these combinations as well.
|
33
|
+
|
34
|
+
## Branches and versions
|
35
|
+
|
36
|
+
The `master` branch corresponds to the current release of the gem. The
|
37
|
+
`develop` branch is used for development of features that will end up in
|
38
|
+
the next minor release. If you fix a bug open a pull request on `master`, if
|
39
|
+
it's a new feature on `develop`.
|
data/lib/appsignal/extension.rb
CHANGED
@@ -13,14 +13,20 @@ end
|
|
13
13
|
|
14
14
|
module Appsignal
|
15
15
|
class Extension
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
16
|
+
class << self
|
17
|
+
def agent_config
|
18
|
+
@agent_config ||= YAML.load(
|
19
|
+
File.read(File.join(File.dirname(__FILE__), '../../ext/agent.yml'))
|
20
|
+
)
|
21
|
+
end
|
22
|
+
|
23
|
+
def agent_version
|
24
|
+
agent_config['version']
|
25
|
+
end
|
21
26
|
|
22
|
-
|
23
|
-
|
27
|
+
def method_missing(m, *args, &block)
|
28
|
+
# Do nothing if the extension methods are not loaded
|
29
|
+
end
|
24
30
|
end
|
25
31
|
end
|
26
32
|
end
|
@@ -4,7 +4,8 @@ module Appsignal
|
|
4
4
|
|
5
5
|
# Called by Mongo::Monitor when query starts
|
6
6
|
def started(event)
|
7
|
-
|
7
|
+
transaction = Appsignal::Transaction.current
|
8
|
+
return if transaction.nil_transaction?
|
8
9
|
return if transaction.paused?
|
9
10
|
|
10
11
|
# Store the query on the transaction, we need it when the event finishes
|
@@ -29,7 +30,8 @@ module Appsignal
|
|
29
30
|
|
30
31
|
# Finishes the event in the AppSignal extension
|
31
32
|
def finish(result, event)
|
32
|
-
|
33
|
+
transaction = Appsignal::Transaction.current
|
34
|
+
return if transaction.nil_transaction?
|
33
35
|
return if transaction.paused?
|
34
36
|
|
35
37
|
# Get the query from the transaction store
|
data/lib/appsignal/version.rb
CHANGED
@@ -18,7 +18,7 @@ describe "extension loading and operation" do
|
|
18
18
|
context "when the extension library can be loaded" do
|
19
19
|
subject { Appsignal::Extension }
|
20
20
|
|
21
|
-
it "should
|
21
|
+
it "should indicate that the extension is loaded" do
|
22
22
|
Appsignal.extension_loaded?.should be_true
|
23
23
|
end
|
24
24
|
|
@@ -74,16 +74,37 @@ describe "extension loading and operation" do
|
|
74
74
|
end
|
75
75
|
|
76
76
|
it "should have a set_gauge method" do
|
77
|
-
|
77
|
+
subject.set_gauge('key', 1.0)
|
78
78
|
end
|
79
79
|
|
80
80
|
it "should have a increment_counter method" do
|
81
|
-
|
81
|
+
subject.increment_counter('key', 1)
|
82
82
|
end
|
83
83
|
|
84
84
|
it "should have a add_distribution_value method" do
|
85
|
-
|
85
|
+
subject.add_distribution_value('key', 1.0)
|
86
86
|
end
|
87
87
|
end
|
88
88
|
end
|
89
|
+
|
90
|
+
context "when the extension library cannot be loaded" do
|
91
|
+
subject { Appsignal::Extension }
|
92
|
+
|
93
|
+
before :all do
|
94
|
+
Appsignal.extension_loaded = false
|
95
|
+
end
|
96
|
+
after :all do
|
97
|
+
Appsignal.extension_loaded = true
|
98
|
+
end
|
99
|
+
|
100
|
+
it "should indicate that the extension is not loaded" do
|
101
|
+
Appsignal.extension_loaded?.should be_false
|
102
|
+
end
|
103
|
+
|
104
|
+
it "should not raise errors when methods are called" do
|
105
|
+
expect {
|
106
|
+
subject.something
|
107
|
+
}.not_to raise_error
|
108
|
+
end
|
109
|
+
end
|
89
110
|
end
|
@@ -91,7 +91,11 @@ describe Appsignal::Hooks::MongoMonitorSubscriber do
|
|
91
91
|
end
|
92
92
|
|
93
93
|
context "without transaction" do
|
94
|
-
before
|
94
|
+
before do
|
95
|
+
Appsignal::Transaction.stub(
|
96
|
+
:current => Appsignal::Transaction::NilTransaction.new
|
97
|
+
)
|
98
|
+
end
|
95
99
|
|
96
100
|
it "should not attempt to start an event" do
|
97
101
|
Appsignal::Extension.should_not receive(:start_event)
|
@@ -107,7 +111,7 @@ describe Appsignal::Hooks::MongoMonitorSubscriber do
|
|
107
111
|
end
|
108
112
|
|
109
113
|
context "when appsignal is paused" do
|
110
|
-
let(:transaction) { double(:paused? => true) }
|
114
|
+
let(:transaction) { double(:paused? => true, :nil_transaction? => false) }
|
111
115
|
before { Appsignal::Transaction.stub(:current => transaction) }
|
112
116
|
|
113
117
|
it "should not attempt to start an event" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: appsignal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.2.beta.
|
4
|
+
version: 1.0.2.beta.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Beekman
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-01-
|
12
|
+
date: 2016-01-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rack
|