cw_ec2_cm 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cw_ec2_cm/version.rb +1 -1
- data/lib/cw_ec2_cm.rb +15 -15
- 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: fbab8be55b50261d691616ac76099e81279ce402
|
4
|
+
data.tar.gz: 144b18a1414f389d4e3d7333ecd92401994a1a6d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7059cf5f3dec2d22ffe40fc60c7821cb291a04df45b35b93c1ab1a290a0c7f0effa85bdf6e7086ffd658f99b78ae2e21213892e385981d59c51870c94dcb98c9
|
7
|
+
data.tar.gz: 923195f822c4a40179f4684231ce140de1c8bc19618d6409b7f41e0da7e7b5c3481da10f556b86b51bfffe16f7f9f326544704b68135fb8eec5dfa60c9bf6e7e
|
data/lib/cw_ec2_cm/version.rb
CHANGED
data/lib/cw_ec2_cm.rb
CHANGED
@@ -44,11 +44,11 @@ module CwEc2Cm
|
|
44
44
|
|
45
45
|
if worst_fs = df_data.max_by{ |fs| fs['pcent'].to_f }
|
46
46
|
metric_data << {
|
47
|
-
"MetricName"
|
48
|
-
"Dimensions"
|
49
|
-
"Timestamp"
|
50
|
-
"Value"
|
51
|
-
"Unit"
|
47
|
+
"MetricName" => "FSUsagePercent",
|
48
|
+
"Dimensions" => [{ "Name" => "InstanceId", "Value" => instance_id }],
|
49
|
+
"Timestamp" => metric_time,
|
50
|
+
"Value" => worst_fs['pcent'].to_f,
|
51
|
+
"Unit" => "Percent" # accepts Seconds, Microseconds, Milliseconds, Bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Bits, Kilobits, Megabits, Gigabits, Terabits, Percent, Count, Bytes/Second, Kilobytes/Second, Megabytes/Second, Gigabytes/Second, Terabytes/Second, Bits/Second, Kilobits/Second, Megabits/Second, Gigabits/Second, Terabits/Second, Count/Second, None
|
52
52
|
}
|
53
53
|
end
|
54
54
|
|
@@ -65,18 +65,18 @@ module CwEc2Cm
|
|
65
65
|
mem_used = mem_total - mem_free
|
66
66
|
mem_percent = (mem_used/mem_total*100).ceil
|
67
67
|
metric_data << {
|
68
|
-
"MetricName"
|
69
|
-
"Dimensions"
|
70
|
-
"Timestamp"
|
71
|
-
"Value"
|
72
|
-
"Unit"
|
68
|
+
"MetricName" => "MemUsagePercent",
|
69
|
+
"Dimensions" => [{ "Name" => "InstanceId", "Value" => instance_id }],
|
70
|
+
"Timestamp" => metric_time,
|
71
|
+
"Value" => mem_percent,
|
72
|
+
"Unit" => "Percent" # accepts Seconds, Microseconds, Milliseconds, Bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Bits, Kilobits, Megabits, Gigabits, Terabits, Percent, Count, Bytes/Second, Kilobytes/Second, Megabytes/Second, Gigabytes/Second, Terabytes/Second, Bits/Second, Kilobits/Second, Megabits/Second, Gigabits/Second, Terabits/Second, Count/Second, None
|
73
73
|
}
|
74
74
|
metric_data << {
|
75
|
-
"MetricName"
|
76
|
-
"Dimensions"
|
77
|
-
"Timestamp"
|
78
|
-
"Value"
|
79
|
-
"Unit"
|
75
|
+
"MetricName" => "MemFree",
|
76
|
+
"Dimensions" => [{ "Name" => "InstanceId", "Value" => instance_id }],
|
77
|
+
"Timestamp" => metric_time,
|
78
|
+
"Value" => mem_free/1024/1024,
|
79
|
+
"Unit" => "Megabytes" # accepts Seconds, Microseconds, Milliseconds, Bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Bits, Kilobits, Megabits, Gigabits, Terabits, Percent, Count, Bytes/Second, Kilobytes/Second, Megabytes/Second, Gigabytes/Second, Terabytes/Second, Bits/Second, Kilobits/Second, Megabits/Second, Gigabits/Second, Terabits/Second, Count/Second, None
|
80
80
|
}
|
81
81
|
|
82
82
|
Tempfile.open('cw-ec2-cm-metrics') do |f|
|