aws_pocketknife 0.1.18 → 0.1.19
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/aws_pocketknife/cli/ecs.rb +23 -8
- data/lib/aws_pocketknife/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c79fc407b1a9fbbf0e56bdbc063e87f8d91fd5fb
|
4
|
+
data.tar.gz: 367f66795712d62ededad96028a7cc4c25e951d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23bc162301d9d3bf8b62009cfbaf582da30915d4fcb6225c1fde01092152f955db4035deb5e770a5420caac0c78e2dedc792ef8c9900f09e1670523813aff1d2
|
7
|
+
data.tar.gz: e1d3d8736766c830cca8783f030a2ef338a2cdd6a565e6577e7537a716ec36b1234ee0dc5fb968392e6060b40225b4d02a6ea15bfa615ee172742c78ccd66543
|
@@ -119,15 +119,17 @@ module AwsPocketknife
|
|
119
119
|
if instances.nil?
|
120
120
|
puts "No instances found"
|
121
121
|
else
|
122
|
+
count = 0
|
123
|
+
mem_cluster_total = 0.0
|
124
|
+
mem_cluster_res_total = 0.0
|
125
|
+
mem_percentage = 0.0
|
126
|
+
cpu_cluster_total = 0.0
|
127
|
+
cpu_cluster_res_total = 0.0
|
128
|
+
cpu_percentage = 0.0
|
129
|
+
pending_tasks_count_total = 0
|
130
|
+
running_tasks_count_total = 0
|
122
131
|
instances.each do |instance|
|
123
132
|
info = instance[:info]
|
124
|
-
# tasks = instance[:tasks]
|
125
|
-
# task_list = []
|
126
|
-
# unless tasks.empty?
|
127
|
-
# tasks.tasks.each do |t|
|
128
|
-
# task_list << t.task_definition_arn.split('/')[1]
|
129
|
-
# end
|
130
|
-
# end
|
131
133
|
cpu_total = info.registered_resources[0].integer_value
|
132
134
|
mem_total = info.registered_resources[1].integer_value
|
133
135
|
cpu_available = info.remaining_resources[0].integer_value
|
@@ -136,8 +138,21 @@ module AwsPocketknife
|
|
136
138
|
data << [instance[:name], info.ec2_instance_id, connected,
|
137
139
|
info.pending_tasks_count, info.running_tasks_count, info.status,
|
138
140
|
"#{cpu_available} / #{cpu_total}", "#{mem_available} / #{mem_total}"
|
139
|
-
]
|
141
|
+
]
|
142
|
+
pending_tasks_count_total = pending_tasks_count_total + info.pending_tasks_count
|
143
|
+
running_tasks_count_total = running_tasks_count_total + info.running_tasks_count
|
144
|
+
mem_cluster_total = mem_cluster_total + mem_total
|
145
|
+
mem_cluster_res_total = mem_cluster_res_total + mem_available
|
146
|
+
mem_percentage = (((mem_cluster_total - mem_cluster_res_total)/mem_cluster_total) * 100).round(2)
|
147
|
+
cpu_cluster_total = cpu_cluster_total + cpu_total
|
148
|
+
cpu_cluster_res_total = cpu_cluster_res_total + cpu_available
|
149
|
+
cpu_percentage = (((cpu_cluster_total - cpu_cluster_res_total)/cpu_cluster_total) * 100).round(2)
|
150
|
+
count = count + 1
|
140
151
|
end
|
152
|
+
data << ["TOTAL (#{count})", "-", "-",
|
153
|
+
pending_tasks_count_total, running_tasks_count_total, "-",
|
154
|
+
"#{cpu_cluster_res_total.round(0)} / #{cpu_cluster_total.round(0)} (#{cpu_percentage} %)", "#{mem_cluster_res_total.round(0)} / #{mem_cluster_total.round(0)} (#{mem_percentage} %)"
|
155
|
+
]
|
141
156
|
AwsPocketknife::Ecs.pretty_table(headers: headers, data: data)
|
142
157
|
end
|
143
158
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aws_pocketknife
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.19
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gustavo Soares Souza
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-07-
|
11
|
+
date: 2017-07-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-core
|