appmap 0.93.0 → 0.93.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
  SHA256:
3
- metadata.gz: 837bc5a036d3217c12b40f46ed7e21406ef298b3ca5c8b712b8ce1f15707434e
4
- data.tar.gz: 763d5c9abd0f8583035117a54c8a6bb0d841089c902ab2e1805ff0795f3acff1
3
+ metadata.gz: 065c32b4761f0e0c6ddbe31d008e6e015935b327a78a948ba546fea284e2e1c5
4
+ data.tar.gz: e960cde3aca40d4d103ffdbb1b9384e827555a0ae53f135142744fdbcd5adc99
5
5
  SHA512:
6
- metadata.gz: 7812c770c07f1e00dc93e0ce4c79598c26daff3fe1d737804dcfc012d29cdefe0754cd3ff06f2810feebe1952cb2038cee2f078d486067188875ec7eb71842de
7
- data.tar.gz: 73db38443e22f4a57bf8575035b4735f7fe044f57dd78f6213ac2694434487732778cb0feacb3733c0565080dd859b22dfcf651ec129b70f028a1500a9ff63ea
6
+ metadata.gz: a2efd8e697df46ae1f65630b49567283e437586b9a4bb6177d08d481a27a13167d2bae303ca27a9b17bcb57d396ed51f4683a1fa617804eb61222deb0ae0fb95
7
+ data.tar.gz: 2cc2eeba86b6b35452dd2b2b3f76b0adeffdcfe0fb54e6a03c85a445de3004abec26dea56b07c117a8e90ce3e9e52115398b993cdc5e322801cf248accbcbbd6
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [0.93.1](https://github.com/getappmap/appmap-ruby/compare/v0.93.0...v0.93.1) (2022-10-04)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * Unyield static asset requests ([4041e4b](https://github.com/getappmap/appmap-ruby/commit/4041e4bbfb44612c5ade2cba334e1ab36a7929e5))
7
+
1
8
  # [0.93.0](https://github.com/getappmap/appmap-ruby/compare/v0.92.1...v0.93.0) (2022-09-22)
2
9
 
3
10
 
@@ -89,39 +89,46 @@ module AppMap
89
89
  # into a separate Tracer.
90
90
  tracer = AppMap.tracing.trace(thread: Thread.current) if record_all_requests?
91
91
 
92
- @app.call(env).tap do |status, headers|
93
- if tracer
94
- AppMap.tracing.delete(tracer)
95
-
96
- events = tracer.events.map(&:to_h)
97
-
98
- appmap_name = "#{req.request_method} #{req.path} (#{status}) - #{start_time.strftime('%T.%L')}"
99
- appmap_file_name = AppMap::Util.scenario_filename([ start_time.to_f, req.url ].join('_'))
100
- output_dir = File.join(AppMap::DEFAULT_APPMAP_DIR, 'requests')
101
- appmap_file_path = File.join(output_dir, appmap_file_name)
102
-
103
- metadata = AppMap.detect_metadata
104
- metadata[:name] = appmap_name
105
- metadata[:timestamp] = start_time.to_f
106
- metadata[:recorder] = {
107
- name: 'rack',
108
- type: 'requests'
109
- }
110
-
111
- appmap = {
112
- version: AppMap::APPMAP_FORMAT_VERSION,
113
- classMap: AppMap.class_map(tracer.event_methods),
114
- metadata: metadata,
115
- events: events
116
- }
117
-
118
- FileUtils.mkdir_p(output_dir)
119
- File.write(appmap_file_path, JSON.generate(appmap))
120
-
121
- headers['AppMap-Name'] = File.expand_path(appmap_name)
122
- headers['AppMap-File-Name'] = File.expand_path(appmap_file_path)
123
- end
92
+ record_request = lambda do |args|
93
+ return unless tracer
94
+
95
+ AppMap.tracing.delete(tracer)
96
+
97
+ status, headers = args
98
+ events = tracer.events.map(&:to_h)
99
+
100
+ event_fields = events.map(&:keys).flatten.map(&:to_sym).uniq.sort
101
+ return unless %i[http_server_request http_server_response].all? { |field| event_fields.include?(field) }
102
+
103
+ path = req.path.gsub(/\/{2,}/, '/') # Double slashes have been observed
104
+ appmap_name = "#{req.request_method} #{path} (#{status}) - #{start_time.strftime('%T.%L')}"
105
+ appmap_file_name = AppMap::Util.scenario_filename([ start_time.to_f, req.url ].join('_'))
106
+ output_dir = File.join(AppMap::DEFAULT_APPMAP_DIR, 'requests')
107
+ appmap_file_path = File.join(output_dir, appmap_file_name)
108
+
109
+ metadata = AppMap.detect_metadata
110
+ metadata[:name] = appmap_name
111
+ metadata[:timestamp] = start_time.to_f
112
+ metadata[:recorder] = {
113
+ name: 'rack',
114
+ type: 'requests'
115
+ }
116
+
117
+ appmap = {
118
+ version: AppMap::APPMAP_FORMAT_VERSION,
119
+ classMap: AppMap.class_map(tracer.event_methods),
120
+ metadata: metadata,
121
+ events: events
122
+ }
123
+
124
+ FileUtils.mkdir_p(output_dir)
125
+ File.write(appmap_file_path, JSON.generate(appmap))
126
+
127
+ headers['AppMap-Name'] = File.expand_path(appmap_name)
128
+ headers['AppMap-File-Name'] = File.expand_path(appmap_file_path)
124
129
  end
130
+
131
+ @app.call(env).tap(&record_request)
125
132
  end
126
133
 
127
134
  def recording_state
@@ -3,7 +3,7 @@
3
3
  module AppMap
4
4
  URL = 'https://github.com/applandinc/appmap-ruby'
5
5
 
6
- VERSION = '0.93.0'
6
+ VERSION = '0.93.1'
7
7
 
8
8
  APPMAP_FORMAT_VERSION = '1.9.0'
9
9
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appmap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.93.0
4
+ version: 0.93.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Gilpin
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-09-22 00:00:00.000000000 Z
11
+ date: 2022-10-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: method_source