jets 0.8.1 → 0.8.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 +4 -4
- data/CHANGELOG.md +3 -0
- data/Gemfile.lock +1 -1
- data/lib/jets/application.rb +2 -1
- data/lib/jets/commands/call.rb +2 -2
- data/lib/jets/commands/templates/skeleton/config/application.rb.tt +6 -2
- data/lib/jets/preheat.rb +22 -0
- data/lib/jets/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 40360dae957d26be5d95365570b65af5b0d865ce8940078c8acbf136ecf4e4fd
|
4
|
+
data.tar.gz: f976b075cf144abfb50385aa57bc0413b1851b4c7e58a346705f83281d93fd77
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d34841937dc1d52101b0079f953e40dad6297b27c56472e7d9e778639774be975ea704d28b025913491b2d419c5e80ef612950d6505d2c71d48d19781d403ed
|
7
|
+
data.tar.gz: b66e879020076d307c1bfb30d2937dc83b56ec94a82fce89e3f63011494da0987baa994d8456ca178ae226f57c2576b26f1104b8bb93d465b02a416068e282f4
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,9 @@
|
|
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
|
+
## [0.8.2]
|
7
|
+
- add prewarm.public_ratio option: http://rubyonjets.com/docs/prewarming/
|
8
|
+
|
6
9
|
## [0.8.1]
|
7
10
|
- Upgrade all cfn resources to use the core jets resource model: request #21 from tongueroo/core-resource2
|
8
11
|
- Rid of mimimal-stack.yml and use jets core resource model
|
data/Gemfile.lock
CHANGED
data/lib/jets/application.rb
CHANGED
@@ -21,8 +21,9 @@ class Jets::Application
|
|
21
21
|
|
22
22
|
config.prewarm = ActiveSupport::OrderedOptions.new
|
23
23
|
config.prewarm.enable = true
|
24
|
+
config.prewarm.rate = '2 hours'
|
24
25
|
config.prewarm.concurrency = 2
|
25
|
-
config.prewarm.
|
26
|
+
config.prewarm.public_ratio = 5
|
26
27
|
|
27
28
|
config.lambdagems = ActiveSupport::OrderedOptions.new
|
28
29
|
config.lambdagems.sources = [
|
data/lib/jets/commands/call.rb
CHANGED
@@ -68,8 +68,8 @@ class Jets::Commands::Call
|
|
68
68
|
begin
|
69
69
|
resp = lambda.invoke(options)
|
70
70
|
rescue Aws::Lambda::Errors::ResourceNotFoundException
|
71
|
-
puts "The function #{function_name} was not found. Maybe check the spelling?".colorize(:red)
|
72
|
-
|
71
|
+
puts "The function #{function_name} was not found. Maybe check the spelling or the AWS_PROFILE?".colorize(:red)
|
72
|
+
return
|
73
73
|
end
|
74
74
|
|
75
75
|
if @options[:show_log]
|
@@ -1,8 +1,12 @@
|
|
1
1
|
Jets.application.configure do
|
2
2
|
config.project_name = "<%= project_name %>"
|
3
3
|
config.api_generator = <%= !!@options[:api] %>
|
4
|
-
|
5
|
-
# config.prewarm.
|
4
|
+
|
5
|
+
# config.prewarm.enable = true # default is true
|
6
|
+
# config.prewarm.rate = '2 hours' # default is '2 hours'
|
7
|
+
# config.prewarm.concurrency = 2 # default is 2
|
8
|
+
# config.prewarm.public_ratio = 5 # default is 5
|
9
|
+
|
6
10
|
# config.env_extra = 2 # can also set this with JETS_ENV_EXTRA
|
7
11
|
# config.extra_autoload_paths = []
|
8
12
|
|
data/lib/jets/preheat.rb
CHANGED
@@ -34,11 +34,33 @@ module Jets
|
|
34
34
|
end
|
35
35
|
end
|
36
36
|
threads.each { |t| t.join }
|
37
|
+
|
38
|
+
# Warm the jets-public_controller more since it gets called more naturally
|
39
|
+
warm_public_controller_more
|
40
|
+
|
37
41
|
# return the funciton names so we can see in the Lambda console
|
38
42
|
# the functions being prewarmed
|
39
43
|
all_functions
|
40
44
|
end
|
41
45
|
|
46
|
+
def warm_public_controller_more
|
47
|
+
function_name = 'jets-public_controller-show' # key function name
|
48
|
+
return unless all_functions.include?(function_name)
|
49
|
+
|
50
|
+
public_ratio = Jets.config.prewarm.public_ratio
|
51
|
+
return if public_ratio == 0
|
52
|
+
|
53
|
+
puts "Prewarming the public controller extra at a ratio of #{public_ratio}" unless @options[:mute]
|
54
|
+
|
55
|
+
threads = []
|
56
|
+
public_ratio.times do
|
57
|
+
threads << Thread.new do
|
58
|
+
warm(function_name)
|
59
|
+
end
|
60
|
+
end
|
61
|
+
threads.each { |t| t.join }
|
62
|
+
end
|
63
|
+
|
42
64
|
# Returns:
|
43
65
|
# [
|
44
66
|
# "posts_controller-index",
|
data/lib/jets/version.rb
CHANGED