appmap 0.93.0 → 0.93.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 837bc5a036d3217c12b40f46ed7e21406ef298b3ca5c8b712b8ce1f15707434e
4
- data.tar.gz: 763d5c9abd0f8583035117a54c8a6bb0d841089c902ab2e1805ff0795f3acff1
3
+ metadata.gz: 44d648e81f7717cbf027f99687c3c69fb558f19540f5882d7098c163ff2968b1
4
+ data.tar.gz: '063487dc2a84f0a0632baadef8133ec8a94f2fad36d0d438f7fa015b6fafec14'
5
5
  SHA512:
6
- metadata.gz: 7812c770c07f1e00dc93e0ce4c79598c26daff3fe1d737804dcfc012d29cdefe0754cd3ff06f2810feebe1952cb2038cee2f078d486067188875ec7eb71842de
7
- data.tar.gz: 73db38443e22f4a57bf8575035b4735f7fe044f57dd78f6213ac2694434487732778cb0feacb3733c0565080dd859b22dfcf651ec129b70f028a1500a9ff63ea
6
+ metadata.gz: d3c6cb7ee444b886b97fb5bbac3825b8aa76efa10f09ab8985e44b1cf421231bf783202d47db166c269a0f80a524d674df9d09a3b2004daf79bb21f31faad528
7
+ data.tar.gz: 7ce3d2ae17406c01360a4cc4319e00b2f940c8a110d96d9bcdcb3418af93d65efb2bbd4fe94c059eb92896044da38a1d6f03293ad44c4a55892bcb77ccabba2e
data/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [0.93.2](https://github.com/getappmap/appmap-ruby/compare/v0.93.1...v0.93.2) (2022-10-07)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * Add language, appmap_dir to generated appmap.yml ([9b5e590](https://github.com/getappmap/appmap-ruby/commit/9b5e590cd9d3d5e5b1115917766a2be6c20f3015))
7
+
8
+ ## [0.93.1](https://github.com/getappmap/appmap-ruby/compare/v0.93.0...v0.93.1) (2022-10-04)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * Unyield static asset requests ([4041e4b](https://github.com/getappmap/appmap-ruby/commit/4041e4bbfb44612c5ade2cba334e1ab36a7929e5))
14
+
1
15
  # [0.93.0](https://github.com/getappmap/appmap-ruby/compare/v0.92.1...v0.93.0) (2022-09-22)
2
16
 
3
17
 
data/lib/appmap/config.rb CHANGED
@@ -346,6 +346,8 @@ module AppMap
346
346
  load(config_data).tap do |config|
347
347
  {
348
348
  'name' => config.name,
349
+ 'language' => 'ruby',
350
+ 'appmap_dir' => AppMap::DEFAULT_APPMAP_DIR,
349
351
  'packages' => config.packages.select{|p| p.path}.map do |pkg|
350
352
  { 'path' => pkg.path }
351
353
  end,
@@ -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.2'
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.2
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-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: method_source