alpha_omega 1.3.8 → 1.3.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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.3.8
1
+ 1.3.9
@@ -2,3 +2,5 @@ require 'alpha_omega/config/deploy_ssh'
2
2
  require 'alpha_omega/config/deploy_challenge'
3
3
  require 'alpha_omega/config/deploy_notify'
4
4
  require 'alpha_omega/config/deploy_localhost'
5
+ require 'alpha_omega/config/deploy_perf'
6
+ require 'alpha_omega/config/deploy_log'
@@ -0,0 +1,8 @@
1
+ Capistrano::Configuration.instance(:must_exist).load do |config|
2
+ on :exit do
3
+ unless ENV['LOCAL_ONLY'] && !ENV['LOCAL_ONLY'].empty?
4
+ logger.important "uploading deploy logs: #{log_path}/#{application}-#{ENV["_AO_DEPLOYER"]}.log-#{Time.now.strftime('%Y%m%d-%H%M')}"
5
+ put full_log, "#{log_path}/#{application}-#{ENV["_AO_DEPLOYER"]}.log-#{Time.now.strftime('%Y%m%d-%H%M')}"
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,44 @@
1
+ # taken from https://github.com/PagerDuty/pd-cap-recipes/blob/master/lib/pd-cap-recipes/tasks/performance.rb
2
+ Capistrano::Configuration.instance(:must_exist).load do |config|
3
+ start_times = {}
4
+ end_times = {}
5
+ order = []
6
+
7
+ on :before do
8
+ order << [:start, current_task]
9
+ start_times[current_task] = Time.now
10
+ end
11
+
12
+ on :after do
13
+ order << [:end, current_task]
14
+ end_times[current_task] = Time.now
15
+ end
16
+
17
+ config.on :exit do
18
+ unless ENV['LOCAL_ONLY'] && !ENV['LOCAL_ONLY'].empty?
19
+ print_report(start_times, end_times, order)
20
+ end
21
+ end
22
+
23
+ def print_report(start_times, end_times, order)
24
+ def l(s)
25
+ logger.info s
26
+ end
27
+
28
+ l " Performance Report"
29
+ l "=========================================================="
30
+
31
+ indent = 0
32
+ (order + [nil]).each_cons(2) do |payload1, payload2|
33
+ action, task = payload1
34
+ if action == :start
35
+ l "#{".." * indent}#{task.fully_qualified_name}" unless task == payload2.last
36
+ indent += 1
37
+ else
38
+ indent -= 1
39
+ l "#{".." * indent}#{task.fully_qualified_name} #{(end_times[task] - start_times[task]).to_i}s"
40
+ end
41
+ end
42
+ l "=========================================================="
43
+ end
44
+ end
@@ -619,14 +619,6 @@ Capistrano::Configuration.instance(:must_exist).load do |config|
619
619
  end
620
620
 
621
621
  end # :deploy
622
-
623
- on :exit do
624
- unless ENV['LOCAL_ONLY'] && !ENV['LOCAL_ONLY'].empty?
625
- logger.important "uploading deploy logs: #{log_path}/#{application}-#{ENV["_AO_DEPLOYER"]}.log-#{Time.now.strftime('%Y%m%d-%H%M')}"
626
- put full_log, "#{log_path}/#{application}-#{ENV["_AO_DEPLOYER"]}.log-#{Time.now.strftime('%Y%m%d-%H%M')}"
627
- end
628
- end
629
-
630
622
  end # Capistrano::Configuration
631
623
 
632
624
  require 'alpha_omega/config/deploy'
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alpha_omega
3
3
  version: !ruby/object:Gem::Version
4
- hash: 11
4
+ hash: 9
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 3
9
- - 8
10
- version: 1.3.8
9
+ - 9
10
+ version: 1.3.9
11
11
  platform: ruby
12
12
  authors:
13
13
  - David Nghiem
@@ -145,7 +145,9 @@ files:
145
145
  - lib/alpha_omega/config/deploy.rb
146
146
  - lib/alpha_omega/config/deploy_challenge.rb
147
147
  - lib/alpha_omega/config/deploy_localhost.rb
148
+ - lib/alpha_omega/config/deploy_log.rb
148
149
  - lib/alpha_omega/config/deploy_notify.rb
150
+ - lib/alpha_omega/config/deploy_perf.rb
149
151
  - lib/alpha_omega/config/deploy_ssh.rb
150
152
  - lib/alpha_omega/deploy/dependencies.rb
151
153
  - lib/alpha_omega/deploy/local_dependency.rb