jets 1.0.2 → 1.0.3

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: a9682b366c1e6cff9d63140310ff2c32d0a132996f1383ad2d1381a43952e3fd
4
- data.tar.gz: 128f7f3d161210124c8c551ca9b0cc1d45b9050d92d80aa9294d66512eaf1e70
3
+ metadata.gz: 9c68122c5a2a85bb9081c2c20f383014bfce1109efe241a0db1762958064ad4a
4
+ data.tar.gz: 6de016056f47eb36e5156017f3fd218b1a3a57ce3b890617fb7d07997c38b794
5
5
  SHA512:
6
- metadata.gz: 4455ad5c44a56286a1f7a5572afa27e0d3119d5822e2bea2f1bbc5f30493a0da397a92ad8724eecdbae17c4dda76dc0475a5e1013a23f0257ef4cb31d21c7387
7
- data.tar.gz: 52122940d1a971055d18d36632d828823349340b311c1b2b76e3dd5e0da0d4e0268078c6f48704115724e6cd44217ab5c1e7aa3fe99ebd40f44178a874312414
6
+ metadata.gz: 1a1386fbe1a7e225f27116dcb23b9e272aeaf84992383b1e08f90d3fc1d2e72c69f487c7f5c223b178362eb772695ac6f6426b1f2d4c4248a9e6dcdc5342ae49
7
+ data.tar.gz: b316f857d5277fb166e0e45e8674fedf8803e6b280b8212600f24967abcf01b6110ccd9fb330295c057aed95a722100f29f6288dc8756000cfcb844eb61cd210
data/CHANGELOG.md CHANGED
@@ -3,6 +3,10 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  This project *loosely tries* to adhere to [Semantic Versioning](http://semver.org/), even before v1.0.
5
5
 
6
+ ## [1.0.3]
7
+ - Allow control to prewarming of rack endpoint more
8
+ - add config.prewarm.rack_ratio setting pull request #55 from tongueroo/prewarm-rack-more
9
+
6
10
  ## [1.0.2]
7
11
  - jets import:rails --submodule option. pull request #54 from tongueroo/import
8
12
  - upgrade to jets-gems. pull request #53 from tongueroo/gems
data/Gemfile.lock CHANGED
@@ -11,7 +11,7 @@ GIT
11
11
  PATH
12
12
  remote: .
13
13
  specs:
14
- jets (1.0.2)
14
+ jets (1.0.3)
15
15
  actionpack (>= 5.2.1)
16
16
  actionview (>= 5.2.1)
17
17
  activerecord (>= 5.2.1)
@@ -30,6 +30,7 @@ class Jets::Application
30
30
  config.prewarm.rate = '30 minutes'
31
31
  config.prewarm.concurrency = 2
32
32
  config.prewarm.public_ratio = 3
33
+ config.prewarm.rack_ratio = 5
33
34
 
34
35
  config.lambdagems = ActiveSupport::OrderedOptions.new
35
36
  config.lambdagems.sources = [
data/lib/jets/preheat.rb CHANGED
@@ -30,14 +30,16 @@ module Jets
30
30
  threads = []
31
31
  all_functions.each do |function_name|
32
32
  next if function_name.include?('jets-public_controller') # handled by warm_public_controller_more
33
+ next if function_name.include?('jets-rack_controller') # handled by warm_rack_controller_more
33
34
  threads << Thread.new do
34
35
  warm(function_name)
35
36
  end
36
37
  end
37
38
  threads.each { |t| t.join }
38
39
 
39
- # Warm the jets-public_controller more since it gets called more naturally
40
+ # Warm the these controllers more since they can be hit more often
40
41
  warm_public_controller_more
42
+ warm_rack_controller_more
41
43
 
42
44
  # return the funciton names so we can see in the Lambda console
43
45
  # the functions being prewarmed
@@ -62,6 +64,25 @@ module Jets
62
64
  threads.each { |t| t.join }
63
65
  end
64
66
 
67
+ def warm_rack_controller_more
68
+ return unless Jets.rack?
69
+ function_name = 'jets-rack_controller-process' # key function name
70
+ return unless all_functions.include?(function_name)
71
+
72
+ rack_ratio = Jets.config.prewarm.rack_ratio
73
+ return if rack_ratio == 0
74
+
75
+ puts "Prewarming the rack controller extra at a ratio of #{rack_ratio}" unless @options[:mute]
76
+
77
+ threads = []
78
+ rack_ratio.times do
79
+ threads << Thread.new do
80
+ warm(function_name)
81
+ end
82
+ end
83
+ threads.each { |t| t.join }
84
+ end
85
+
65
86
  # Returns:
66
87
  # [
67
88
  # "posts_controller-index",
data/lib/jets/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Jets
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jets
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen