appsignal 0.9.5 → 0.9.6

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: 548376adc60aed0084092d6088e3949df194190c
4
- data.tar.gz: fba4858b4cb9603946311dcc244c47f6bbf26b0a
3
+ metadata.gz: 60fe669e8daa8b4015255cecaaa4f785b8fce679
4
+ data.tar.gz: f04514a5ba7022f74f1c7657a06ae584f968fa03
5
5
  SHA512:
6
- metadata.gz: 3f6f27716d46a3b8f3a17046bca5b4415406aefc6af0d6810f934abf646b2148c59b968a00225ad2aa224f6673d33492eb94e3e358ee1670d43be9a54241e9e2
7
- data.tar.gz: c491d2e9401ea8c68436f3f770d22a36cd45cd32c4b8ccba5b9f43921622f0b64cc5d08bbb2a6589ef28c0bb3642d1b61c1e6693e1e441866ac1c324ad0e8152
6
+ metadata.gz: 7b0c0d4c2557517439b529f95e9e71dec934ddd44a4f4b080516faad591efb5d4392816d2d839ac0a1309b236e21e51ad1552d6a1f56033440d8f912124d10dd
7
+ data.tar.gz: 72cb94912a40af82c53e166600d238f197b1c8373060e93e1100d0a6aabf55dc122f9495dd0c7f2dfc27be49d102162dd9e90955698008ef047e0b32a1377d9d
@@ -1,4 +1,4 @@
1
- # 0.9.5
1
+ # 0.9.6
2
2
  * Convert to primitives before sending through pipe
3
3
 
4
4
  # 0.9.4
@@ -59,7 +59,7 @@ Yanked
59
59
  * Alias tag_request to tag_job, for background jobs
60
60
  * Skip sanitization of env if env is nil
61
61
  * Small bugfix in forking logic
62
- * Don't send params if send_params is off in config
62
+ * Don't send params if send_params is off in config
63
63
  * Remove --repository option in CLI
64
64
  * Name option in appsignal notify_of_deploy CLI
65
65
  * Don't call to_hash on ENV
@@ -85,7 +85,7 @@
85
85
  end
86
86
 
87
87
  def exception?
88
- !!exception
88
+ !! exception
89
89
  end
90
90
 
91
91
  def slow_request?
@@ -98,20 +98,32 @@
98
98
  end
99
99
 
100
100
  def truncate!
101
+ return if truncated?
101
102
  process_action_event.payload.clear
102
103
  events.clear
103
104
  tags.clear
104
105
  sanitized_environment.clear
105
106
  sanitized_session_data.clear
106
107
  @env = nil
108
+ @truncated = true
109
+ end
110
+
111
+ def truncated?
112
+ !! @truncated
107
113
  end
108
114
 
109
115
  def convert_values_to_primitives!
116
+ return if have_values_been_converted_to_primitives?
110
117
  Appsignal::Transaction::ParamsSanitizer.sanitize!(@process_action_event.payload) if @process_action_event
111
118
  @events.map do |o|
112
119
  Appsignal::Transaction::ParamsSanitizer.sanitize(o.payload)
113
120
  end
114
121
  add_sanitized_context!
122
+ @have_values_been_converted_to_primitives = true
123
+ end
124
+
125
+ def have_values_been_converted_to_primitives?
126
+ !! @have_values_been_converted_to_primitives
115
127
  end
116
128
 
117
129
  def type
@@ -129,6 +141,7 @@
129
141
  Appsignal.transactions.delete(@request_id)
130
142
  if process_action_event || exception?
131
143
  if Appsignal::Pipe.current
144
+ convert_values_to_primitives!
132
145
  Appsignal.logger.debug("Writing transaction to pipe: #{@request_id}")
133
146
  Appsignal::Pipe.current.write(self)
134
147
  else
@@ -1,3 +1,3 @@
1
1
  module Appsignal
2
- VERSION = '0.9.5'
2
+ VERSION = '0.9.6'
3
3
  end
@@ -234,6 +234,15 @@ describe Appsignal::Transaction do
234
234
  subject.process_action_event.payload.should be_empty
235
235
  subject.events.should be_empty
236
236
  subject.tags.should be_empty
237
+ subject.truncated?.should be_true
238
+ end
239
+
240
+ it "should not truncate twice" do
241
+ subject.process_action_event.payload.should_receive(:clear).once
242
+ subject.events.should_receive(:clear).once
243
+
244
+ subject.truncate!
245
+ subject.truncate!
237
246
  end
238
247
  end
239
248
 
@@ -282,6 +291,14 @@ describe Appsignal::Transaction do
282
291
  subject
283
292
  event_payload.should == before
284
293
  end
294
+
295
+ it "should not covert to primitives twice" do
296
+ transaction.convert_values_to_primitives!
297
+ transaction.have_values_been_converted_to_primitives?.should be_true
298
+
299
+ Appsignal::Transaction::ParamsSanitizer.should_not_receive(:sanitize!)
300
+ transaction.convert_values_to_primitives!
301
+ end
285
302
  end
286
303
  end
287
304
 
@@ -355,12 +372,20 @@ describe Appsignal::Transaction do
355
372
 
356
373
  context 'when using pipes' do
357
374
  let(:pipe) { double }
358
- before { Appsignal::Pipe.stub(:current => pipe) }
375
+ before do
376
+ Appsignal::Pipe.stub(:current => pipe)
377
+ pipe.stub(:write => true)
378
+ transaction.stub(:convert_values_to_primitives! => true)
379
+ end
359
380
 
360
381
  it "should send itself trough the pipe" do
361
382
  pipe.should_receive(:write).with(transaction)
362
383
  end
363
384
 
385
+ it "should convert itself to primitives" do
386
+ transaction.should_receive(:convert_values_to_primitives!)
387
+ end
388
+
364
389
  after { transaction.complete! }
365
390
  end
366
391
  end
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: 0.9.5
4
+ version: 0.9.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Beekman
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2014-08-06 00:00:00.000000000 Z
15
+ date: 2014-08-07 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: activesupport