aws_pocketknife 0.1.23 → 0.1.24

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: a905dab1c729293da8624fca40f5549a095378a8
4
- data.tar.gz: e011a7b84b9aa2ed22ea4aea4dfb7d6f5fc951a3
3
+ metadata.gz: 19ad8446907eb841bc3d38706aa027880443bf25
4
+ data.tar.gz: 1eaad90a4f81172db80eb3cf1c4adb1705b66a37
5
5
  SHA512:
6
- metadata.gz: 0a7c5493e68f1717c80fc5eb693a9e9f5762130813c5cb9bdcb2132dff7ff3c0e060d1c4f371d60b13fba9c921899121b8d9af6b4de1da73e2bac30964ccd72b
7
- data.tar.gz: d9d3d7d27a839f03c607a0aef9ca726547ceff16c4d35e3601cbd16ffa2b4a358215fa7955714104676faf67991eacb82969343e882a426961bca65a4ccabe01
6
+ metadata.gz: f15e20b95dcea964567ba815066df899dcd145632011c4a734a65391904c2c78f0cf48c5005ef51fb19a82645aa0bd3f7aac48527444f98045d029c4a5995fb8
7
+ data.tar.gz: 592e8002cc830cabfa8bf98e4e22a602ab73e9c9f788f59df4e7c54810fe0c1d0643d537ee905dc8aef50d9e666c41f6b6a3e2f73bb58e5e5113e02002aff15a
@@ -115,8 +115,8 @@ module AwsPocketknife
115
115
  "pending_tasks_count","running_tasks_count", "status",
116
116
  "cpu (units)", "mem (MiB)"
117
117
  ]
118
- headers_2 = ["total",
119
- "total pending", "total running",
118
+ headers_2 = ["active", "draining",
119
+ "tasks pending", "tasks running",
120
120
  "cpu_reserved / cpu_total", "mem_reserved / mem_total"
121
121
  ]
122
122
  data = []
@@ -124,7 +124,8 @@ module AwsPocketknife
124
124
  if instances.nil?
125
125
  puts "No instances found"
126
126
  else
127
- count = 0
127
+ count_active = 0
128
+ count_draining = 0
128
129
  mem_cluster_total = 0.0
129
130
  mem_cluster_res_total = 0.0
130
131
  mem_percentage = 0.0
@@ -146,15 +147,16 @@ module AwsPocketknife
146
147
  ]
147
148
  pending_tasks_count_total = pending_tasks_count_total + info.pending_tasks_count
148
149
  running_tasks_count_total = running_tasks_count_total + info.running_tasks_count
149
- mem_cluster_total = mem_cluster_total + mem_total
150
+ mem_cluster_total = mem_cluster_total + mem_total if info.status == "ACTIVE"
150
151
  mem_cluster_res_total = mem_cluster_res_total + mem_available if info.status == "ACTIVE"
151
152
  mem_percentage = (((mem_cluster_total - mem_cluster_res_total)/mem_cluster_total) * 100).round(2)
152
- cpu_cluster_total = cpu_cluster_total + cpu_total
153
+ cpu_cluster_total = cpu_cluster_total + cpu_total if info.status == "ACTIVE"
153
154
  cpu_cluster_res_total = cpu_cluster_res_total + cpu_available if info.status == "ACTIVE"
154
155
  cpu_percentage = (((cpu_cluster_total - cpu_cluster_res_total)/cpu_cluster_total) * 100).round(2)
155
- count = count + 1
156
+ count_active = count_active + 1 if info.status == "ACTIVE"
157
+ count_draining = count_draining + 1 if info.status == "DRAINING"
156
158
  end
157
- data_2 << [count,
159
+ data_2 << [count_active, count_draining,
158
160
  pending_tasks_count_total, running_tasks_count_total,
159
161
  "#{(cpu_cluster_total - cpu_cluster_res_total).round(0)} / #{cpu_cluster_total.round(0)} (#{cpu_percentage} %)", "#{(mem_cluster_total - mem_cluster_res_total).round(0)} / #{mem_cluster_total.round(0)} (#{mem_percentage} %)"
160
162
  ]
@@ -4,6 +4,7 @@ require "aws_pocketknife"
4
4
  module AwsPocketknife
5
5
  module Cli
6
6
  class Main < Thor
7
+ map %w[--version -v] => :__print_version
7
8
 
8
9
  desc "ec2 SUBCOMMAND ...ARGS", "ec2 command lines"
9
10
  subcommand "ec2", AwsPocketknife::Cli::Ec2
@@ -32,6 +33,11 @@ module AwsPocketknife
32
33
  desc "ecs SUBCOMMAND ...ARGS", "ecs command lines"
33
34
  subcommand "ecs", AwsPocketknife::Cli::Ecs
34
35
 
36
+ desc "--version, -v", "print the version"
37
+ def __print_version
38
+ puts AwsPocketknife::VERSION
39
+ end
40
+
35
41
  end
36
42
  end
37
43
  end
@@ -1,3 +1,3 @@
1
1
  module AwsPocketknife
2
- VERSION = "0.1.23"
2
+ VERSION = "0.1.24"
3
3
  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.23
4
+ version: 0.1.24
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-08-14 00:00:00.000000000 Z
11
+ date: 2018-06-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-core
@@ -287,7 +287,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
287
287
  version: '0'
288
288
  requirements: []
289
289
  rubyforge_project:
290
- rubygems_version: 2.6.10
290
+ rubygems_version: 2.6.13
291
291
  signing_key:
292
292
  specification_version: 4
293
293
  summary: Command line tools to make aws administration a little bit easier and faster