vector 0.0.5 → 0.0.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
  SHA1:
3
- metadata.gz: 541f21bb927907e0a40dc80e6383fafadbfed41b
4
- data.tar.gz: 608fb28e14b4f8b6e35ae093ef30d02346b910ca
3
+ metadata.gz: 07a60786d7b8111e9a6d00a5a316477e385e5066
4
+ data.tar.gz: 355b002c3f11ae3ac4eb6dc440c06f2ac5a80730
5
5
  SHA512:
6
- metadata.gz: e54156a992bdec104878d7be100673797e153198d3f9888307df09966421ec7c63833529745a4c61cba22c905f9df8b7f8c9aa56bd1900c510b12ebe97a6b30e
7
- data.tar.gz: 272cdb7eba79cdc60425fb2c14dbbb793911696b62c401e695f97beeacd2f48b198e1b25e48e082013bdd747578378b532f737d8e04f929be76892de760fddfb
6
+ metadata.gz: 9902bc75ba6da80cf50325d6ea68e0b1ce0be41ffcbd83de825e3690bcd7212a38ca52e8153016c31c4110f48536b98a7812b9ccb75dd947d77b593c52839581
7
+ data.tar.gz: d69df377f6ed4eb40bf47b805c6392c5dd1a6cdbadfd395dc694da6fa9d37bcc454bbf5f12aaf0da08bfb146118b7db31539bdad9ad9317d00661a4f695ae566
@@ -46,7 +46,11 @@ module Vector
46
46
 
47
47
  def hlog(string)
48
48
  return unless @@enabled
49
- puts "[#{@components.join ','}] #{string}"
49
+ puts "[#{hlog_ctx_string}] #{string}"
50
+ end
51
+
52
+ def hlog_ctx_string
53
+ @components.join ','
50
54
  end
51
55
  end
52
56
  end
@@ -48,7 +48,7 @@ module Vector
48
48
  if policy.adjustment_type == "ChangeInCapacity" &&
49
49
  ps_check_procs &&
50
50
  ps_check_procs.any? {|ps_check_proc|
51
- ps_check_proc.call(group.desired_capacity + policy.scaling_adjustment) }
51
+ ps_check_proc.call(group.desired_capacity + policy.scaling_adjustment, self) }
52
52
  hlog("Predictive scaleup would trigger a scaleup if group were shrunk")
53
53
  next
54
54
  end
@@ -130,9 +130,10 @@ module Vector
130
130
  hlog("Not all datapoints are beneath the variable threshold #{(threshold * 100).to_i}: #{stats.datapoints}")
131
131
  next
132
132
  end
133
+
134
+ hlog("Variable threshold: #{(threshold * 100).to_i}, #{group.desired_capacity} nodes")
133
135
  end
134
136
 
135
- outside_cooldown = outside_cooldown_period(group)
136
137
  unless outside_cooldown_period(group)
137
138
  hlog("Group is not outside the specified cooldown periods")
138
139
  next
@@ -75,15 +75,29 @@ module Vector
75
75
 
76
76
  # now take the past total load and divide it by the
77
77
  # current number of instances to get the predicted value
78
- check_proc = Proc.new do |num_nodes|
78
+
79
+ # (we capture our original log context here in order to display
80
+ # the source of these checks later when this proc is called by
81
+ # scaledown stuff).
82
+ orig_ctx = hlog_ctx_string
83
+ check_proc = Proc.new do |num_nodes, logger|
79
84
  predicted_value = past_load.to_f / num_nodes
80
- hlog "Predicted #{alarm.metric.name}: #{predicted_value} (#{num_nodes} nodes)"
85
+
86
+ log_str = "Predicted #{alarm.metric.name}: #{predicted_value} (#{num_nodes} nodes)"
87
+
88
+ # Tack on the original context if we're in a different logger
89
+ # (for the case where this is called during scaledown checks).
90
+ if orig_ctx != logger.hlog_ctx_string
91
+ log_str += " (from #{orig_ctx})"
92
+ end
93
+
94
+ logger.hlog log_str
81
95
 
82
96
  check_alarm_threshold(alarm, predicted_value)
83
97
  end
84
98
  result[:check_procs] << check_proc
85
99
 
86
- if check_proc.call(now_num)
100
+ if check_proc.call(now_num, self)
87
101
  if @dry_run
88
102
  hlog "Executing policy (DRY RUN)"
89
103
  else
@@ -1,3 +1,3 @@
1
1
  module Vector
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vector
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zach Wily
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-13 00:00:00.000000000 Z
11
+ date: 2015-01-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk