cloudwatch-metrics 0.1.16 → 0.1.18

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
  SHA256:
3
- metadata.gz: 97790dd4bec2f067aeca87ba8aabaa580fbb98f793125258d4bdb53fea42da5d
4
- data.tar.gz: 6ea60c0395cd756541de4c87bf81b74fd06f26f467be9bdd21d3cb2fb52381cd
3
+ metadata.gz: bb25220c1a1041c0a0cad1c509ee026b8e11e67cce20bd7915eac08399a744ae
4
+ data.tar.gz: f811ba53260f3a52bf6b9b413c754fdf57b70cf6fd916b3d32d5ad2b8bd62d95
5
5
  SHA512:
6
- metadata.gz: 8767e36b91438b6178ebe96cac9a1a712629279afa37b20dd4624ae46319d6279544b3d63dc537fdf44272d286c790f9eb6f40b31e013391ace747e96b7c86bf
7
- data.tar.gz: 16fb72d30d8f932f17e47281eee1c23d234a93fb222426c3b7423b9fb4fb30bff8746f366c619b7ac1d1a4f07e551684dfc05c1eea4d30864e04cdad0fdf3d71
6
+ metadata.gz: 466bd419bae4aaceb19fcaaff3ad9e51dab0a64958a15c0411c9c8b32ab8e3cf05c069f2e193d30bf70699ad1b956eabbf12159c67b27b843aef222964258091
7
+ data.tar.gz: 373d1bd9b1bc401c3dfa30e5229b98aa067c8e67f0d19254db52ddef475f610503666d0e8b1c91c9ea26b65e997859416acc8ae6d5f811705341b7227bea157e
data/README.md CHANGED
@@ -27,36 +27,36 @@ The initializer contains descriptions for all available options. The only option
27
27
 
28
28
  Available methods are in the `CloudwatchMetrics` module. For convenience this is aliased to `CW` by default.
29
29
 
30
- Metrics are reported using `CW.report` for single data points, or `CW.report_all` for collections of data points. Required and optional parameters for these methods are detailed below.
30
+ Metrics are recorded using `CW.record` for single data points, or `CW.record_all` for collections of data points. Required and optional parameters for these methods are detailed below.
31
31
 
32
- ### CW.report Required Parameters
32
+ ### CW.record Required Parameters
33
33
 
34
- * `metric_name`: The name of the metric.
35
- * `value`: The value for the single data point being reported.
34
+ * `name`: The name of the metric.
35
+ * `value`: The value for the single data point being recorded.
36
36
 
37
- E.g. `CW.report(metric_name: 'search_result_count', value: 25)`
37
+ E.g. `CW.record(name: 'search_result_count', value: 25)`
38
38
 
39
39
 
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.
40
+ `CW.record_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
- ### CW.report_all Required Parameters
42
+ ### CW.record_all Required Parameters
43
43
 
44
- * `metric_name`: The name of the metric.
45
- * `values`: Array of values for the data points being reported.
44
+ * `name`: The name of the metric.
45
+ * `values`: Array of values for the data points being recorded.
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(metric_name: 'search_result_count', values: [25, 50, 65], counts: [1, 2, 1])`
48
+ E.g. `CW.record_all(name: 'search_result_count', values: [25, 50, 65], counts: [1, 2, 1])`
49
49
 
50
50
  ### Optional Parameters
51
51
 
52
- Both reporting methods accept optional parameters, which are detailed below, along with their default values
52
+ Both recording methods accept optional parameters, which are detailed below, along with their default values
53
53
 
54
54
  * `unit`: The unit of measure for this data point. Units help provide conceptual meaning to your data, but CloudWatch attaches no significance to a unit internally. Common values are `Seconds`, `Kilobytes`, `Percent`, `Count`, `Kilobytes/Second`. Default value is `None`. A full list of available units is available at `CloudwatchMetrics.Units`.
55
55
  * `namespace`: Override the namespace set in the initializer. Default is `nil`
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(metric_name: 'search_result_count', value: 25, unit: CW.COUNT, namespace: 'custom_namespace', dimensions: { group: 'A', subgroup: 'B' }, timeStamp: Time.current - 1.day)`
59
+ E.g. `CW.record(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
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CloudwatchMetrics
4
- VERSION = '0.1.16'
4
+ VERSION = '0.1.18'
5
5
  end
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative 'cloudwatch_metrics/configuration'
4
+ require_relative 'cloudwatch_metrics/constants'
4
5
 
5
6
  # Posts custom metrics to AWS CloudWatch
6
7
  module CloudwatchMetrics
@@ -16,10 +17,10 @@ module CloudwatchMetrics
16
17
  end
17
18
 
18
19
  def record(
19
- metric_name:, value:, unit: nil, namespace: configuration.namespace, dimensions: [], timestamp: nil
20
+ name:, value:, unit: nil, namespace: configuration.namespace, dimensions: [], timestamp: nil
20
21
  )
21
22
  metric_data = [{
22
- metric_name: metric_name,
23
+ metric_name: name,
23
24
  value: value,
24
25
  unit: unit,
25
26
  dimensions: map_dimensions(dimensions),
@@ -29,10 +30,10 @@ module CloudwatchMetrics
29
30
  end
30
31
 
31
32
  def record_all(
32
- metric_name:, values:, counts:, unit: nil, namespace: configuration.namespace, dimensions: [], timestamp: nil
33
+ name:, values:, counts:, unit: nil, namespace: configuration.namespace, dimensions: [], timestamp: nil
33
34
  )
34
35
  metric_data = [{
35
- metric_name: metric_name,
36
+ metric_name: name,
36
37
  values: values,
37
38
  counts: counts,
38
39
  unit: unit,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudwatch-metrics
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.16
4
+ version: 0.1.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Seth Puckett