scout_apm 1.4.0 → 1.4.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ecdf92000eedbccd7433a68129281cd82847556c
|
4
|
+
data.tar.gz: e703b9dfa3aaf7f2a048ff31b9e6c66777dd3a35
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ceadce82ba6554b9217f5fc7d99b6f949db06d59c53f5728a48b23c6cba78a0ee068ad56cb04272879d35bd935fa1bf739fa93ed5618be96f57f3b3ebbf8aa3b
|
7
|
+
data.tar.gz: d75d311f1304aeecfa3b3be98ca3dc7874ba7d932c5a389f3b879f8d9dfca5b5ef782cc3bae5959d7d5ff0be7b461252046d19c33ce7943828d80e087f203ee1
|
data/CHANGELOG.markdown
CHANGED
@@ -31,20 +31,18 @@ module ScoutApm
|
|
31
31
|
"{#{str_parts.join(",")}}"
|
32
32
|
end
|
33
33
|
|
34
|
+
ESCAPE_MAPPINGS = {
|
35
|
+
"\b" => '\\b',
|
36
|
+
"\t" => '\\t',
|
37
|
+
"\n" => '\\n',
|
38
|
+
"\f" => '\\f',
|
39
|
+
"\r" => '\\r',
|
40
|
+
'"' => '\\"',
|
41
|
+
'\\' => '\\\\',
|
42
|
+
}
|
43
|
+
|
34
44
|
def escape(string)
|
35
|
-
string
|
36
|
-
escapers = {
|
37
|
-
'\b' => '\\b',
|
38
|
-
'\t' => '\\t',
|
39
|
-
'\n' => '\\n',
|
40
|
-
'\f' => '\\f',
|
41
|
-
'\r' => '\\r',
|
42
|
-
'"' => '\\"',
|
43
|
-
'\\' => '\\\\'
|
44
|
-
}
|
45
|
-
# TODO escape control chars
|
46
|
-
escapers.each {|bad, good| string = string.gsub(bad, good)}
|
47
|
-
string
|
45
|
+
ESCAPE_MAPPINGS.inject(string.to_s) {|s, (bad, good)| s.gsub(bad, good) }
|
48
46
|
end
|
49
47
|
|
50
48
|
def format_by_type(formatee)
|
data/lib/scout_apm/version.rb
CHANGED
@@ -116,7 +116,7 @@ class PayloadSerializerTest < Minitest::Test
|
|
116
116
|
def test_serializes_slow_transactions_as_json
|
117
117
|
slow_transaction_metrics = {
|
118
118
|
ScoutApm::MetricMeta.new('ActiveRecord/all').tap { |meta|
|
119
|
-
meta.desc = "SELECT
|
119
|
+
meta.desc = "SELECT *\nfrom users where filter=?"
|
120
120
|
meta.extra = {:user => 'cooluser'}
|
121
121
|
meta.metric_id = nil
|
122
122
|
meta.scope = "Controller/apps/checkin"
|
@@ -163,7 +163,7 @@ class PayloadSerializerTest < Minitest::Test
|
|
163
163
|
"key" => {
|
164
164
|
"bucket" => "ActiveRecord",
|
165
165
|
"name" => "all",
|
166
|
-
"desc" => "SELECT
|
166
|
+
"desc" => "SELECT *\nfrom users where filter=?",
|
167
167
|
"extra" => {
|
168
168
|
"user" => "cooluser",
|
169
169
|
},
|
@@ -195,6 +195,7 @@ class PayloadSerializerTest < Minitest::Test
|
|
195
195
|
]
|
196
196
|
}
|
197
197
|
]
|
198
|
+
|
198
199
|
assert_equal formatted_slow_transactions, JSON.parse(payload)["slow_transactions"]
|
199
200
|
end
|
200
201
|
|
@@ -212,4 +213,9 @@ class PayloadSerializerTest < Minitest::Test
|
|
212
213
|
}
|
213
214
|
assert_equal formatted_metadata, JSON.parse(payload)["metadata"]
|
214
215
|
end
|
216
|
+
|
217
|
+
def test_escapes_newlines
|
218
|
+
json = { "foo" => "\bbar\nbaz\r" }
|
219
|
+
assert_equal json, JSON.parse(ScoutApm::Serializers::PayloadSerializerToJson.jsonify_hash(json))
|
220
|
+
end
|
215
221
|
end
|
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.4.
|
4
|
+
version: 1.4.1
|
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-02-
|
12
|
+
date: 2016-02-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: minitest
|