joyent-cloud-pricing 1.0.7 → 1.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pricing/analyzer.rb +4 -0
- data/lib/pricing/reporter.rb +18 -1
- data/lib/pricing/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aac73146144562c99dbb072fc766712d3793029d
|
4
|
+
data.tar.gz: ff9efc1f136467be58322a9ce8335ae1b5c81f88
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0835ae276c4a763e3534662c5adfafc79ad3139fe5b77606e095eb87e28029fef851d5e5a852707ca450dd3838cd9722ed448fcedc100d551c03a07143f10205
|
7
|
+
data.tar.gz: 3fbb855a0a63c05a872320e557e944b48c2f55c3c035a008b2ce2abcde463607d19473c0100b13c9a3f7365ba136906c6568d560c29b86e35e7f36d215ed3e8a
|
data/lib/pricing/analyzer.rb
CHANGED
data/lib/pricing/reporter.rb
CHANGED
@@ -65,6 +65,18 @@ module Joyent::Cloud::Pricing
|
|
65
65
|
end
|
66
66
|
end
|
67
67
|
|
68
|
+
def unknown_flavor_zone_list
|
69
|
+
analyzer.unknown_zone_counts.keys
|
70
|
+
end
|
71
|
+
|
72
|
+
def over_reserved_zone_list
|
73
|
+
analyzer.over_reserved_zone_counts.keys
|
74
|
+
end
|
75
|
+
|
76
|
+
def zone_list_for_print(list, format = ' %-40s')
|
77
|
+
list.map{|k| sprintf(format, k) }.join("\n")
|
78
|
+
end
|
79
|
+
|
68
80
|
SEPARATOR = ('.' * 65).cyan
|
69
81
|
PROPS_FORMAT= '%20d %20d %20d'
|
70
82
|
REPORT_ASCII = <<ASCII
|
@@ -74,7 +86,8 @@ module Joyent::Cloud::Pricing
|
|
74
86
|
were excluded from calculations. Add them to legacy_prices.yml.
|
75
87
|
|
76
88
|
List of flavors with unknown properties:
|
77
|
-
<%= @r.analyzer.unknown_zone_counts.keys.
|
89
|
+
Total # of unrecognized flavor zones <%= sprintf("%20d", @r.analyzer.unknown_zone_counts.keys.size).red %>
|
90
|
+
<%= @r.zone_list_for_print(@r.unknown_flavor_zone_list).red %>
|
78
91
|
<%= SEPARATOR %>
|
79
92
|
|
80
93
|
<%- end -%>
|
@@ -82,8 +95,12 @@ ZONE COUNTS:
|
|
82
95
|
Total # of zones <%= sprintf("%20d", @r.zones).cyan %>
|
83
96
|
<%- if @r.reserve? -%>
|
84
97
|
Total # of reserved zones <%= sprintf("%20d", @r.commit.total_zones).green %>
|
98
|
+
<%- if @r.analyzer.have_over_reserved_zones? -%>
|
85
99
|
Total # of reserved but absent zones <%= value = sprintf("%20d", @r.analyzer.over_reserved_zone_counts.size || 0); value == "0" ? value.blue : value.red %>
|
100
|
+
<%= @r.zone_list_for_print(@r.over_reserved_zone_list).red %>
|
86
101
|
<%- end -%>
|
102
|
+
<%- end -%>
|
103
|
+
<%= SEPARATOR %>
|
87
104
|
|
88
105
|
Resources in use:<%= sprintf('%14s %15s %15s', 'Reserved', 'On-Demand', 'Total') %>
|
89
106
|
CPUs <%= props = @r.zone_props_to_string(:cpus, 16); props[0].green + props[1].yellow + props[2].cyan %>
|
data/lib/pricing/version.rb
CHANGED