dial 0.1.8 → 0.1.9

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: 0bb2a49d25b9e1d11931b2bc987ad87098b04d7f29787b91422fae8ca482ca41
4
- data.tar.gz: 73b24362f41546bee29b3df431c9edc611264c9d6cd662fed450c13f6f48e377
3
+ metadata.gz: 31949e2dbaf8b3ca4f422ae02115747913ce3bd704b0aaf8d45d5956d0ba2ac5
4
+ data.tar.gz: aecdd78df3d7e50c0dd9b98c67c0f7633d6cc2fa43ea33d01987a148dff53cf0
5
5
  SHA512:
6
- metadata.gz: bfb8d6bfba055cc017a379740c23ed7daf6a0ab6141e360b44f9cc8ed168242d7f6d5ee1aeeb03b6c7974cda3cd759130cae17ace399f8ac7abc6e00433db1a3
7
- data.tar.gz: 388af81b669f651ab4dde3086b3ce3afd3736c3ef127956f33eb8f1f785fd98bd373696e9cfc808fed1276c7dbef7aff460b645e398ae7f637971230eb990225
6
+ metadata.gz: 21ed80548f3559308cfdc13ff69df8168ef87ffa6268faea8d5901e2209cbd1e9f775bcbd48db355e83c1d3e48cb59f285af0c0271fc1fa14442852c84dab521
7
+ data.tar.gz: 202f8d84d6ce0520b7bf53df0cac7545a85f1c6f723c845158c9161cf52f1a1a6fbe55e70671a70c9bf1ca43aad052d28d2f10b3a7572ea34c5747090121ab98
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.1.9] - 2025-01-27
4
+
5
+ - Increase default vernier allocation interval from 10k to 100k
6
+
3
7
  ## [0.1.8] - 2025-01-27
4
8
 
5
9
  - Require ruby 3.3.0 or later
@@ -7,8 +7,11 @@ module Dial
7
7
 
8
8
  REQUEST_TIMING_HEADER = "dial_request_timing"
9
9
 
10
- PROFILE_OUT_STALE_SECONDS = 60 * 60
11
- PROFILE_OUT_RELATIVE_DIRNAME = "tmp/dial/profiles"
10
+ FILE_STALE_SECONDS = 60 * 60
11
+
12
+ VERNIER_INTERVAL = 500
13
+ VERNIER_ALLOCATION_INTERVAL = 100_000
14
+ VERNIER_PROFILE_OUT_RELATIVE_DIRNAME = "tmp/dial/profiles"
12
15
 
13
16
  PROSOPITE_IGNORE_QUERIES = [/schema_migrations/].freeze
14
17
  PROSOPITE_LOG_RELATIVE_DIRNAME = "log/dial"
@@ -4,7 +4,7 @@ Dial::Engine.routes.draw do
4
4
  scope path: "/dial", as: "dial" do
5
5
  get "profile", to: lambda { |env|
6
6
  uuid = env[::Rack::QUERY_STRING].sub "uuid=", ""
7
- path = String ::Rails.root.join Dial::PROFILE_OUT_RELATIVE_DIRNAME, "#{uuid}.json"
7
+ path = String ::Rails.root.join Dial::VERNIER_PROFILE_OUT_RELATIVE_DIRNAME, "#{uuid}.json"
8
8
 
9
9
  if File.exist? path
10
10
  [
@@ -25,7 +25,7 @@ module Dial
25
25
  status, headers, rack_body = nil
26
26
  ruby_vm_stat, gc_stat, gc_stat_heap = nil
27
27
  ::Prosopite.scan do
28
- ::Vernier.profile out: profile_out_pathname, interval: 500, allocation_interval: 10_000, hooks: [:memory_usage, :rails] do
28
+ ::Vernier.profile out: profile_out_pathname, interval: VERNIER_INTERVAL, allocation_interval: VERNIER_ALLOCATION_INTERVAL, hooks: [:memory_usage, :rails] do
29
29
  ruby_vm_stat, gc_stat, gc_stat_heap = with_diffed_ruby_stats do
30
30
  status, headers, rack_body = @app.call env
31
31
  end
@@ -109,7 +109,7 @@ module Dial
109
109
  end
110
110
 
111
111
  def profile_out_dir_pathname
112
- ::Rails.root.join PROFILE_OUT_RELATIVE_DIRNAME
112
+ ::Rails.root.join VERNIER_PROFILE_OUT_RELATIVE_DIRNAME
113
113
  end
114
114
 
115
115
  def query_log_dir_pathname
data/lib/dial/railtie.rb CHANGED
@@ -14,7 +14,7 @@ module Dial
14
14
 
15
15
  initializer "dial.set_up_vernier" do |app|
16
16
  app.config.after_initialize do
17
- FileUtils.mkdir_p ::Rails.root.join PROFILE_OUT_RELATIVE_DIRNAME
17
+ FileUtils.mkdir_p ::Rails.root.join VERNIER_PROFILE_OUT_RELATIVE_DIRNAME
18
18
  end
19
19
  end
20
20
 
@@ -50,12 +50,12 @@ module Dial
50
50
  def stale_files glob_pattern
51
51
  Dir.glob(glob_pattern).select do |file|
52
52
  timestamp = Util.uuid_timestamp Util.file_name_uuid File.basename file
53
- timestamp < Time.now - PROFILE_OUT_STALE_SECONDS
53
+ timestamp < Time.now - FILE_STALE_SECONDS
54
54
  end
55
55
  end
56
56
 
57
57
  def profile_out_dir_pathname
58
- ::Rails.root.join PROFILE_OUT_RELATIVE_DIRNAME
58
+ ::Rails.root.join VERNIER_PROFILE_OUT_RELATIVE_DIRNAME
59
59
  end
60
60
 
61
61
  def query_log_dir_pathname
data/lib/dial/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dial
4
- VERSION = "0.1.8"
4
+ VERSION = "0.1.9"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dial
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Young