app_profiler 0.1.5 → 0.1.6

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: 11304574ae151e5775c7cbac93ace38b9784c25bec088b39b4288eae719a0d1e
4
- data.tar.gz: d0a698c95c617c4a337c9e31953b374f5f3a9d6126df942674928491c81e97c5
3
+ metadata.gz: 443e88eecba7bccc081c2b44d2a0840570c54793025251e960242bd76dc86090
4
+ data.tar.gz: fcc47ff7544b73faa76160212b1ef0134b2f7239de758ec8af86887abe41ef59
5
5
  SHA512:
6
- metadata.gz: b511cd5273c64b1f58597e6a12e668b78e2d5037e63626e4cb34927b3814fb0fb7962fee01973a6be71d928f04596a71525fac3c62bbaadabea6b49121dbae5c
7
- data.tar.gz: 507918c0fcb2d4e2321b5401bdd243a3a74fdc256576bdd4be0eddf7441a73bbed4738a9a880d6e507918db0d2a6d9c05bc10adb67a3b6741b7e22fdf16e67e2
6
+ metadata.gz: 7fda25b4c3e449d7f8c35341649c96679e299dbc3110e44911dcd1e970bce64b0abf2aaf3fe4830ba729fdac3780477ff626b6451579a74bdd2ceac6cf9c866b
7
+ data.tar.gz: 3f5020c4c4a5c817c4692a622001fa7ad851316b20cfdb0ad0057a04ab2e0d6736d1dae17e397d5a7d6aa9b2eab464c1dc39f3e0e653dc46530e96ec7eaf86c6
@@ -7,7 +7,7 @@ module AppProfiler
7
7
  def call(profile, response: nil, autoredirect: nil, async: false)
8
8
  if async
9
9
  profile.enqueue_upload
10
- response[1][AppProfiler.profile_async_header] = true
10
+ response[1][AppProfiler.profile_async_header] = "true"
11
11
  else
12
12
  profile_upload = profile.upload
13
13
 
@@ -75,7 +75,7 @@ module AppProfiler
75
75
 
76
76
  def path
77
77
  filename = [
78
- Time.zone.now.strftime("%Y%m%d-%H%M%S"),
78
+ AppProfiler.profile_file_prefix.call,
79
79
  mode,
80
80
  id,
81
81
  Socket.gethostname,
@@ -36,6 +36,7 @@ module AppProfiler
36
36
  AppProfiler.profile_url_formatter = app.config.app_profiler.profile_url_formatter
37
37
  AppProfiler.upload_queue_max_length = app.config.app_profiler.upload_queue_max_length || 10
38
38
  AppProfiler.upload_queue_interval_secs = app.config.app_profiler.upload_queue_interval_secs || 5
39
+ AppProfiler.profile_file_prefix = app.config.app_profiler.profile_file_prefix || DefaultProfilePrefix
39
40
  end
40
41
 
41
42
  initializer "app_profiler.add_middleware" do |app|
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AppProfiler
4
- VERSION = "0.1.5"
4
+ VERSION = "0.1.6"
5
5
  end
data/lib/app_profiler.rb CHANGED
@@ -13,6 +13,10 @@ module AppProfiler
13
13
  "#{AppProfiler.speedscope_host}#profileURL=#{upload.url}"
14
14
  end
15
15
 
16
+ DefaultProfilePrefix = proc do
17
+ Time.zone.now.strftime("%Y%m%d-%H%M%S")
18
+ end
19
+
16
20
  module Storage
17
21
  autoload :BaseStorage, "app_profiler/storage/base_storage"
18
22
  autoload :FileStorage, "app_profiler/storage/file_storage"
@@ -50,6 +54,7 @@ module AppProfiler
50
54
  mattr_accessor :server, default: Server
51
55
  mattr_accessor :upload_queue_max_length, default: 10
52
56
  mattr_accessor :upload_queue_interval_secs, default: 5
57
+ mattr_accessor :profile_file_prefix, default: DefaultProfilePrefix
53
58
 
54
59
  class << self
55
60
  def run(*args, &block)
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.1.5
4
+ version: 0.1.6
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: 2023-09-25 00:00:00.000000000 Z
16
+ date: 2023-10-18 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: activesupport
@@ -175,7 +175,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
175
175
  - !ruby/object:Gem::Version
176
176
  version: '0'
177
177
  requirements: []
178
- rubygems_version: 3.4.19
178
+ rubygems_version: 3.4.21
179
179
  signing_key:
180
180
  specification_version: 4
181
181
  summary: Collect performance profiles for your Rails application.