cloudwatch-metrics 0.1.16 → 0.1.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -5
- data/lib/cloudwatch_metrics/version.rb +1 -1
- data/lib/cloudwatch_metrics.rb +4 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dfe7fbdd2e3121c9144df74e1e620277b0d9c1d019eefcbc62592e979d575cf2
|
4
|
+
data.tar.gz: e4c052ef871bd758454ebbd52d931eb2af554c0cf3e13ca2aad612cf533c39e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ac092df3e27dc27438a72d8e1962fd35a5ea623074c0853f29874c31f90518090555389a9e4d63e8ea88491b40643e2f80d8e531ce9d66b8438ce0826cf90d2
|
7
|
+
data.tar.gz: 8fe6aa51871bef6c68df7d00c22a421834a057c722c819fb7efd58a588f3a8bc03710fb22a445906a01b16d5e7aa61edb84f647100b73aeb8415eab9c11fc220
|
data/README.md
CHANGED
@@ -31,21 +31,21 @@ Metrics are reported using `CW.report` for single data points, or `CW.report_all
|
|
31
31
|
|
32
32
|
### CW.report Required Parameters
|
33
33
|
|
34
|
-
* `
|
34
|
+
* `name`: The name of the metric.
|
35
35
|
* `value`: The value for the single data point being reported.
|
36
36
|
|
37
|
-
E.g. `CW.report(
|
37
|
+
E.g. `CW.report(name: 'search_result_count', value: 25)`
|
38
38
|
|
39
39
|
|
40
40
|
`CW.report_all` has a similar method signature, but takes an array of values, and a corresponding array indicating how many times each value occurred during the period.
|
41
41
|
|
42
42
|
### CW.report_all Required Parameters
|
43
43
|
|
44
|
-
* `
|
44
|
+
* `name`: The name of the metric.
|
45
45
|
* `values`: Array of values for the data points being reported.
|
46
46
|
* `counts`: Array of numbers indicating the number of times each value occurred during the period. The length of this array should match the length of the `values` array.
|
47
47
|
|
48
|
-
E.g. `CW.report_all(
|
48
|
+
E.g. `CW.report_all(name: 'search_result_count', values: [25, 50, 65], counts: [1, 2, 1])`
|
49
49
|
|
50
50
|
### Optional Parameters
|
51
51
|
|
@@ -56,7 +56,7 @@ Both reporting methods accept optional parameters, which are detailed below, alo
|
|
56
56
|
* `dimensions`: A hash of name/value pairs that form part of the identity of a metric. Dimensions allow you to group and filter data points within a particular metric. Default is `nil`.
|
57
57
|
* `timestamp`: The time associated with the data point. The timestamp can be up to two weeks in the past and up to two hours into the future. Default is the current time.
|
58
58
|
|
59
|
-
E.g. `CW.report(
|
59
|
+
E.g. `CW.report(name: 'search_result_count', value: 25, unit: CW.COUNT, namespace: 'custom_namespace', dimensions: { group: 'A', subgroup: 'B' }, timeStamp: Time.current - 1.day)`
|
60
60
|
|
61
61
|
### Local development
|
62
62
|
|
data/lib/cloudwatch_metrics.rb
CHANGED
@@ -16,10 +16,10 @@ module CloudwatchMetrics
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def record(
|
19
|
-
|
19
|
+
name:, value:, unit: nil, namespace: configuration.namespace, dimensions: [], timestamp: nil
|
20
20
|
)
|
21
21
|
metric_data = [{
|
22
|
-
metric_name:
|
22
|
+
metric_name: name,
|
23
23
|
value: value,
|
24
24
|
unit: unit,
|
25
25
|
dimensions: map_dimensions(dimensions),
|
@@ -29,10 +29,10 @@ module CloudwatchMetrics
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def record_all(
|
32
|
-
|
32
|
+
name:, values:, counts:, unit: nil, namespace: configuration.namespace, dimensions: [], timestamp: nil
|
33
33
|
)
|
34
34
|
metric_data = [{
|
35
|
-
metric_name:
|
35
|
+
metric_name: name,
|
36
36
|
values: values,
|
37
37
|
counts: counts,
|
38
38
|
unit: unit,
|