newrelic-dragonfly 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9bee35d73a1966dd8db2e8984f89b4a62ca3283b
4
- data.tar.gz: 98ab249c1f6d4a16d837ca631ea0ac4f6e8cc3fa
3
+ metadata.gz: d4034dddc94d3027cf42706b8f4331714d02f18f
4
+ data.tar.gz: 4f8ae40b4b01a61c4993e34b0298f3b854c4126e
5
5
  SHA512:
6
- metadata.gz: be72ae86d18bf365bb7fe5358ac36626752380c0f761b4cb344cd2a16110976150d207e6c4b3361029d4e342090e72d50c9a74d8e129e78515023c7b36e0032a
7
- data.tar.gz: 377aaa90be843b7df40a34b50d22b2d50eefe7988ff2af559a823cf5fceed5707979a67b88170a0a777e712e0d8f6e23b1515b0a9f3a8f0736506065bc35f945
6
+ metadata.gz: 4a7efd36b1970de415d385a2b64c289a0a2b7acea85478a4526fa20fbdacc16e2865cf50471fe4ebd4b4db3cc1278240beaf53dafd86db7236a898160c89aa46
7
+ data.tar.gz: 6a0a819d3e40aab17e0e95eaeff634e108a7a959715d32eb5fa8da4681e87247429821d275a5074057eb64c2edb559719dab4fb685f270376495ac80f7ab896d
data/Gemfile CHANGED
@@ -4,6 +4,7 @@ source 'https://rubygems.org'
4
4
  gemspec
5
5
 
6
6
  group :test do
7
+ gem 'dragonfly-s3_data_store'
7
8
  gem 'pry-debugger'
8
9
  gem 'rack-test'
9
10
  gem 'rspec'
@@ -88,7 +88,7 @@ DependencyDetection.defer do
88
88
  end
89
89
 
90
90
  executes do
91
- class Dragonfly::DataStorage::S3DataStore
91
+ class Dragonfly::S3DataStore
92
92
  include NewRelic::Agent::MethodTracer
93
93
  add_method_tracer :write
94
94
  add_method_tracer :read
@@ -1,5 +1,5 @@
1
1
  module Newrelic
2
2
  module Dragonfly
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
@@ -3,7 +3,12 @@ require 'spec_helper'
3
3
  describe Newrelic::Dragonfly do
4
4
  include Rack::Test::Methods
5
5
 
6
- let(:app) { Dragonfly.app(:images).configure_with(:imagemagick) }
6
+ let(:root_path) { Dir.mktmpdir }
7
+ after { FileUtils.remove_entry_secure root_path }
8
+
9
+ let(:app) { Dragonfly.app(:images) }
10
+ before { app.use_datastore :file, root_path: root_path }
11
+
7
12
  let(:uid) { app.store fixture('sample.png') }
8
13
 
9
14
  let(:agent) { NewRelic::Agent.instance }
@@ -21,3 +26,19 @@ describe Newrelic::Dragonfly do
21
26
  agent.transaction_sampler.last_sample.to_s.should include 'Dragonfly::ImageMagick::Processors::Encode'
22
27
  end
23
28
  end
29
+
30
+ describe Newrelic::Dragonfly, Dragonfly::S3DataStore do
31
+ include Rack::Test::Methods
32
+
33
+ let(:app) { Dragonfly.app(:images) }
34
+ before { app.use_datastore :s3, bucket_name: 'dragonfly', access_key_id: 'dummy', secret_access_key: 'dummy' }
35
+
36
+ let(:uid) { app.store fixture('sample.png') }
37
+
38
+ let(:agent) { NewRelic::Agent.instance }
39
+
40
+ it 'include s3 instrumentation' do
41
+ get app.create.fetch(uid).url
42
+ agent.transaction_sampler.last_sample.to_s.should include 'Dragonfly::S3DataStore'
43
+ end
44
+ end
data/spec/spec_helper.rb CHANGED
@@ -6,7 +6,14 @@ Bundler.require :default, :test
6
6
 
7
7
  RSpec.configure do |config|
8
8
  config.before(:suite) do
9
- Dragonfly.app(:images).configure_with(:imagemagick)
9
+ Fog.mock!
10
+ end
11
+
12
+ config.before(:suite) do
13
+ Dragonfly.logger = Logger.new STDOUT
14
+ Dragonfly.app(:images).configure do
15
+ plugin :imagemagick
16
+ end
10
17
  end
11
18
 
12
19
  config.before(:suite) do
@@ -15,8 +22,9 @@ RSpec.configure do |config|
15
22
  end
16
23
 
17
24
  config.before(:each) do
18
- @engine = NewRelic::Agent.instance.stats_engine
19
- @engine.clear_stats
25
+ agent = NewRelic::Agent.instance
26
+ agent.stats_engine.clear_stats
27
+ agent.transaction_sampler.reset!
20
28
  end
21
29
  end
22
30
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: newrelic-dragonfly
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - miyucy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-27 00:00:00.000000000 Z
11
+ date: 2014-01-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler