app_profiler 0.0.4 → 0.0.5

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: c0ea530a74f742510112821254aa5626e33d1937637b135ec8f3dcc4affc4802
4
- data.tar.gz: c7fd02891a558831a37954aa316c9fe2ed0fda688593acc1866a3d02d16bb60f
3
+ metadata.gz: 98267c893c5f34a6f4f1423093cf48059c1f22ca9e63ec70d8f7a2c7b2dda2a8
4
+ data.tar.gz: ad8c50e169904b526b7cf2d891253635a2c3209f712ab919cecce6b5070c8b49
5
5
  SHA512:
6
- metadata.gz: 8b007ad9d7cf38d762d72b8da248dad1bde666c1f93f1b8c0f2109bf23cf3ea74b3d50523836bf4bf4b3b72066542ae69bbbfd0c14a61b0571b7d05dd85b75a9
7
- data.tar.gz: 6638578ee89dbccfe89fa918fb3c0f9108ccbbcc6d4ae3dd383ee55994f721ed6067023f56133469b1d2e164ae57c9aef12987c75123e3dc93c12ee8cdf53aa3
6
+ metadata.gz: b6749cd765d02ad703ccbf7aaaa7c69b9df88ef036cbce00de9aaadf8e3099635d406076ceaae3a66e4c2c174b25da681b69f4165e645b583e357d88e7c5c5e2
7
+ data.tar.gz: a1d948cb61a6171cd97e8cea5514a024fca92b49b28e1383d69f1e9f9ddd4c0ed5b3a1ccafa0267d71086d4d35ce4392300781f60915816eb2000a15c7676947
@@ -32,6 +32,7 @@ module AppProfiler
32
32
  mattr_accessor :autoredirect, default: false
33
33
  mattr_reader :profile_header, default: "X-Profile"
34
34
  mattr_accessor :context, default: nil
35
+ mattr_reader :profile_url_formatter, default: nil
35
36
 
36
37
  mattr_accessor :storage, default: Storage::FileStorage
37
38
  mattr_accessor :viewer, default: Viewer::SpeedscopeViewer
@@ -57,5 +58,9 @@ module AppProfiler
57
58
  def profile_data_header
58
59
  @@profile_data_header ||= profile_header.dup << "-Data" # rubocop:disable Style/ClassVars
59
60
  end
61
+
62
+ def profile_url_formatter=(block)
63
+ @@profile_url_formatter = block # rubocop:disable Style/ClassVars
64
+ end
60
65
  end
61
66
  end
@@ -34,7 +34,11 @@ module AppProfiler
34
34
  end
35
35
 
36
36
  def profile_url(upload)
37
- "#{AppProfiler.speedscope_host}#profileURL=#{upload.url}"
37
+ if AppProfiler.profile_url_formatter.nil?
38
+ "#{AppProfiler.speedscope_host}#profileURL=#{upload.url}"
39
+ else
40
+ AppProfiler.profile_url_formatter.call(upload)
41
+ end
38
42
  end
39
43
 
40
44
  def profile_data_url(upload)
@@ -25,6 +25,7 @@ module AppProfiler
25
25
  "tmp", "app_profiler"
26
26
  )
27
27
  AppProfiler.context = app.config.app_profiler.context || Rails.env
28
+ AppProfiler.profile_url_formatter = app.config.app_profiler.profile_url_formatter
28
29
  end
29
30
 
30
31
  initializer "app_profiler.add_middleware" do |app|
@@ -11,6 +11,10 @@ module AppProfiler
11
11
  def url
12
12
  @file
13
13
  end
14
+
15
+ def name
16
+ @file.basename
17
+ end
14
18
  end
15
19
 
16
20
  class << self
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AppProfiler
4
- VERSION = "0.0.4"
4
+ VERSION = "0.0.5"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: app_profiler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gannon McGibbon
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2020-05-25 00:00:00.000000000 Z
16
+ date: 2020-06-17 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: activesupport