scout_apm 1.2.2 → 1.2.3.pre

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: ba5c475b02675dc137c1393e629891935ce8b340
4
- data.tar.gz: a3b06a62571ee7b152351fee4893f2a9c395f067
3
+ metadata.gz: 3a03b4be29a88aee577ac82dc4f7eba338ff3f70
4
+ data.tar.gz: bffbbb70f8a8a027d01ce37e2782dedd1c16e194
5
5
  SHA512:
6
- metadata.gz: 046bf02d7bb03cec29d3922d5711353e61a873674ba82ee07bf9012ecd421fbfdcf872a8f88867c18604618b5173ca99352ec5ff66696a0c4a0c5b3bf77f0abc
7
- data.tar.gz: dc675677e74bbb7138423b2268c8b3886338f95eed9db8d45f369f25c1149206f9cbf23d44f13e4bb2b5678b342757122c613c0db09710d6979bca1dc88f4226
6
+ metadata.gz: 5ef56e96fb084291c28381997cab3c43abf92b25353c7a13a02dcaa331ed24cdd5a08f864b1ad8dbcbdffbeb4ed5ecb72cda27eb11bceefce4624d848697d2b4
7
+ data.tar.gz: baa32e0a5e06615c0bbbbcc6558bd9ad82127dc17c8edaa194529925faf60db0c469159219d695f15607134e3011e51eef08932ff7f37ce77a6c95860c5e6d4b
data/CHANGELOG.markdown CHANGED
@@ -1,3 +1,7 @@
1
+ # 1.2.3
2
+
3
+ * Trimming metrics from slow requests if there are more than 10.
4
+
1
5
  # 1.2.2
2
6
 
3
7
  * Collapse middleware recordings to minimize payload size
@@ -51,6 +51,10 @@ module ScoutApm
51
51
  self
52
52
  end
53
53
 
54
+ def has_metrics?
55
+ metrics and metrics.any?
56
+ end
57
+
54
58
  def as_json
55
59
  json_attributes = [:key, :time, :total_call_time, :uri, [:context, :context_hash], :prof]
56
60
  ScoutApm::AttributeArranger.call(self, json_attributes)
@@ -101,6 +101,7 @@ module ScoutApm
101
101
 
102
102
  def merge_slow_transactions!(slow_transactions)
103
103
  @slow_transactions += Array(slow_transactions)
104
+ trim_slow_transaction_metrics
104
105
  self
105
106
  end
106
107
 
@@ -117,6 +118,21 @@ module ScoutApm
117
118
 
118
119
  private
119
120
 
121
+ # Removes payloads from slow transactions that exceed +SlowRequestPolicy::MAX_DETAIL_PER_MINUTE+ to avoid
122
+ # bloating the layaway file.
123
+ def trim_slow_transaction_metrics
124
+ count_with_metrics = 0
125
+ @slow_transactions.each do |s|
126
+
127
+ if s.has_metrics?
128
+ count_with_metrics += 1
129
+ if count_with_metrics > SlowRequestPolicy::MAX_DETAIL_PER_MINUTE
130
+ s.clear_metrics!
131
+ end
132
+ end
133
+ end
134
+ end
135
+
120
136
  # We can't aggregate CPU, Memory, Capacity, or Controller, so pass through these metrics directly
121
137
  # TODO: Figure out a way to not have this duplicate what's in Samplers, and also on server's ingest
122
138
  PASSTHROUGH_METRICS = ["CPU", "Memory", "Instance", "Controller"]
@@ -1,4 +1,4 @@
1
1
  module ScoutApm
2
- VERSION = "1.2.2"
2
+ VERSION = "1.2.3.pre"
3
3
  end
4
4
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scout_apm
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.2.3.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Derek Haynes
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-01-06 00:00:00.000000000 Z
12
+ date: 2016-01-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: minitest
@@ -164,12 +164,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
164
164
  version: '0'
165
165
  required_rubygems_version: !ruby/object:Gem::Requirement
166
166
  requirements:
167
- - - ">="
167
+ - - ">"
168
168
  - !ruby/object:Gem::Version
169
- version: '0'
169
+ version: 1.3.1
170
170
  requirements: []
171
171
  rubyforge_project: scout_apm
172
- rubygems_version: 2.2.2
172
+ rubygems_version: 2.4.8
173
173
  signing_key:
174
174
  specification_version: 4
175
175
  summary: Ruby application performance monitoring