passenger-metrics 0.0.2 → 0.0.6

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
- SHA1:
3
- metadata.gz: 19607add3c1eba0885de2cd4b357cd2a2fdaaaec
4
- data.tar.gz: 7d09e2131b6d75357ded041bad405de8cd325991
2
+ SHA256:
3
+ metadata.gz: e0873c6e0f2746b18947a4f4115fdf2e055db45e3eda4bd292e6bf22ebbd98a1
4
+ data.tar.gz: 49c13c5db27283bab2c6bb08d18e83ef56b5899b5b81b648b99f5f511550b19e
5
5
  SHA512:
6
- metadata.gz: 08c213d38ecbce23c589b543e009d5bf7ebd57d7411e68f6c27daf22f226d2b8f56cbf94bad4345c21d629d709563f30906cddc8609e467a24760f9dc8872913
7
- data.tar.gz: 9ca01bd3bf795a4eab1ac59d58b3d3a342ea11a37f7a885ee133806d829fb6e02ed203a29468d57f71a5ae1e96f200935296a5cf9b83f147f72c7ffe7cd4b9b9
6
+ metadata.gz: 2dd70f966eddd86674c10a68a71958d62339041b9808dc2cdc42fc43265723e7160c6fc1ba2ee9e97517d0af71c0a31aada70120963d22ea7e4fb18a17ef03e8
7
+ data.tar.gz: 9e815080c684a23487287f67941e3fc9848aa9c0b8fb9538d16437a56436a635705142723933319af1fe380ad54c452925f535e0429c8ee7f62ebbdf491d7874
@@ -0,0 +1,14 @@
1
+ name: CI
2
+ on: [push]
3
+
4
+ jobs:
5
+ test:
6
+ runs-on: ubuntu-latest
7
+ steps:
8
+ - uses: actions/checkout@v2
9
+ - uses: ruby/setup-ruby@477b21f02be01bcb8030d50f37cfec92bfa615b6
10
+ with:
11
+ ruby-version: 2.7
12
+ bundler-cache: true
13
+ - run: bundle install
14
+ - run: bundle exec rspec
data/Gemfile CHANGED
@@ -1,15 +1,13 @@
1
1
  source "http://rubygems.org"
2
- # Add dependencies required to use your gem here.
3
- gem 'crack'
4
- gem 'aws-sdk'
5
2
 
6
- # Add dependencies to develop your gem here.
7
- # Include everything needed to run rake, tests, features, etc.
3
+ gem 'crack', '~> 0.4.3'
4
+ gem 'aws-sdk-cloudwatch'
5
+ gem 'aws-sdk-ec2'
6
+
8
7
  group :development do
9
- gem "rspec", ">= 0"
10
- gem "bundler", "~> 1.0"
11
- gem "jeweler", "~> 2.0.1"
12
- gem 'guard'
8
+ gem 'rspec', '>= 0'
9
+ gem 'jeweler', '~> 2.1', '>= 2.1.2'
10
+ gem 'guard', '~> 2.13'
13
11
  gem 'guard-rspec', require: false
14
12
  gem 'byebug'
15
13
  end
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
1
  # passenger-metrics
2
2
  A ruby gem for reading metrics from the passenger-status command.
3
3
 
4
-
4
+ [![CI Status](https://github.com/controlshift/passenger-metrics/actions/workflows/ci.yml/badge.svg)](https://github.com/controlshift/passenger-metrics/actions/workflows/ci.yml)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.2
1
+ 0.0.4
@@ -1,10 +1,19 @@
1
- require 'aws-sdk'
1
+ require 'aws-sdk-cloudwatch'
2
+ require 'aws-sdk-ec2'
2
3
  require 'crack'
3
4
 
4
5
  module PassengerMetrics
5
6
  def self.status
6
7
  @status ||= PassengerMetrics::Status.new
7
8
  end
9
+
10
+ def self.instance_id
11
+ @instance_id ||= @_metadata_client.get('/latest/meta-data/instance-id')
12
+ end
13
+
14
+ def self.metadata_client
15
+ @_metadata_client ||= Aws::EC2Metadata.new
16
+ end
8
17
  end
9
18
 
10
19
  require 'passenger-metrics/metrics/base'
@@ -1,3 +1,5 @@
1
+ require 'net/http'
2
+
1
3
  module PassengerMetrics
2
4
  class Cloudwatch
3
5
  DEFAULT_NAMESPACE = "Passenger"
@@ -51,7 +53,7 @@ module PassengerMetrics
51
53
  end
52
54
 
53
55
  def dimension_value
54
- ENV["AWS_CLOUDWATCH_DIMENSION_VALUE"] || DEFAULT_DIMENSION_VALUE
56
+ ENV["AWS_CLOUDWATCH_DIMENSION_VALUE"] || instance_id || DEFAULT_DIMENSION_VALUE
55
57
  end
56
58
 
57
59
  def dimensions
@@ -77,5 +79,9 @@ module PassengerMetrics
77
79
  def client
78
80
  @client ||= ::Aws::CloudWatch::Client.new region: 'us-east-1'
79
81
  end
82
+
83
+ def instance_id
84
+ PassengerMetrics.instance_id
85
+ end
80
86
  end
81
87
  end
@@ -2,27 +2,27 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: passenger-metrics 0.0.2 ruby lib
5
+ # stub: passenger-metrics 0.0.4 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
- s.name = "passenger-metrics"
9
- s.version = "0.0.2"
8
+ s.name = "passenger-metrics".freeze
9
+ s.version = "0.0.6"
10
10
 
11
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
- s.require_paths = ["lib"]
13
- s.authors = ["Nathan Woodhull"]
14
- s.date = "2016-03-09"
15
- s.description = "Get passenger metrics from passenger-status into the analytics tool of your choice."
16
- s.email = "nathan@gcontrolshiftlabs.com"
17
- s.executables = ["passenger-metrics-cloudwatch"]
11
+ s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
+ s.require_paths = ["lib".freeze]
13
+ s.authors = ["Nathan Woodhull".freeze]
14
+ s.date = "2021-08-04"
15
+ s.description = "Get passenger metrics from passenger-status into the analytics tool of your choice.".freeze
16
+ s.email = "nathan@gcontrolshiftlabs.com".freeze
17
+ s.executables = ["passenger-metrics-cloudwatch".freeze]
18
18
  s.extra_rdoc_files = [
19
19
  "LICENSE",
20
20
  "README.md"
21
21
  ]
22
22
  s.files = [
23
+ ".github/workflows/ci.yml",
23
24
  ".rspec",
24
25
  "Gemfile",
25
- "Gemfile.lock",
26
26
  "Guardfile",
27
27
  "LICENSE",
28
28
  "README.md",
@@ -46,42 +46,31 @@ Gem::Specification.new do |s|
46
46
  "spec/spec_helper.rb",
47
47
  "spec/status_spec.rb"
48
48
  ]
49
- s.homepage = "http://github.com/controlshift/passenger-metrics"
50
- s.licenses = ["MIT"]
51
- s.rubygems_version = "2.4.8"
52
- s.summary = "ruby interface to passenger-status"
49
+ s.homepage = "http://github.com/controlshift/passenger-metrics".freeze
50
+ s.licenses = ["MIT".freeze]
51
+ s.rubygems_version = "3.1.6".freeze
52
+ s.summary = "ruby interface to passenger-status".freeze
53
53
 
54
54
  if s.respond_to? :specification_version then
55
55
  s.specification_version = 4
56
+ end
56
57
 
57
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
58
- s.add_runtime_dependency(%q<crack>, [">= 0"])
59
- s.add_runtime_dependency(%q<aws-sdk>, [">= 0"])
60
- s.add_development_dependency(%q<rspec>, [">= 0"])
61
- s.add_development_dependency(%q<bundler>, ["~> 1.0"])
62
- s.add_development_dependency(%q<jeweler>, ["~> 2.0.1"])
63
- s.add_development_dependency(%q<guard>, [">= 0"])
64
- s.add_development_dependency(%q<guard-rspec>, [">= 0"])
65
- s.add_development_dependency(%q<byebug>, [">= 0"])
66
- else
67
- s.add_dependency(%q<crack>, [">= 0"])
68
- s.add_dependency(%q<aws-sdk>, [">= 0"])
69
- s.add_dependency(%q<rspec>, [">= 0"])
70
- s.add_dependency(%q<bundler>, ["~> 1.0"])
71
- s.add_dependency(%q<jeweler>, ["~> 2.0.1"])
72
- s.add_dependency(%q<guard>, [">= 0"])
73
- s.add_dependency(%q<guard-rspec>, [">= 0"])
74
- s.add_dependency(%q<byebug>, [">= 0"])
75
- end
58
+ if s.respond_to? :add_runtime_dependency then
59
+ s.add_runtime_dependency(%q<crack>.freeze, ["~> 0.4.3"])
60
+ s.add_runtime_dependency(%q<aws-sdk-cloudwatch>.freeze, [">= 0"])
61
+ s.add_development_dependency(%q<rspec>.freeze, [">= 0"])
62
+ s.add_development_dependency(%q<jeweler>.freeze, ["~> 2.1", ">= 2.1.2"])
63
+ s.add_development_dependency(%q<guard>.freeze, ["~> 2.13"])
64
+ s.add_development_dependency(%q<guard-rspec>.freeze, [">= 0"])
65
+ s.add_development_dependency(%q<byebug>.freeze, [">= 0"])
76
66
  else
77
- s.add_dependency(%q<crack>, [">= 0"])
78
- s.add_dependency(%q<aws-sdk>, [">= 0"])
79
- s.add_dependency(%q<rspec>, [">= 0"])
80
- s.add_dependency(%q<bundler>, ["~> 1.0"])
81
- s.add_dependency(%q<jeweler>, ["~> 2.0.1"])
82
- s.add_dependency(%q<guard>, [">= 0"])
83
- s.add_dependency(%q<guard-rspec>, [">= 0"])
84
- s.add_dependency(%q<byebug>, [">= 0"])
67
+ s.add_dependency(%q<crack>.freeze, ["~> 0.4.3"])
68
+ s.add_dependency(%q<aws-sdk-cloudwatch>.freeze, [">= 0"])
69
+ s.add_dependency(%q<rspec>.freeze, [">= 0"])
70
+ s.add_dependency(%q<jeweler>.freeze, ["~> 2.1", ">= 2.1.2"])
71
+ s.add_dependency(%q<guard>.freeze, ["~> 2.13"])
72
+ s.add_dependency(%q<guard-rspec>.freeze, [">= 0"])
73
+ s.add_dependency(%q<byebug>.freeze, [">= 0"])
85
74
  end
86
75
  end
87
76
 
metadata CHANGED
@@ -1,31 +1,31 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: passenger-metrics
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Woodhull
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-09 00:00:00.000000000 Z
11
+ date: 2021-08-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: crack
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: 0.4.3
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: 0.4.3
27
27
  - !ruby/object:Gem::Dependency
28
- name: aws-sdk
28
+ name: aws-sdk-cloudwatch
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
@@ -52,48 +52,40 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
- - !ruby/object:Gem::Dependency
56
- name: bundler
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: '1.0'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - "~>"
67
- - !ruby/object:Gem::Version
68
- version: '1.0'
69
55
  - !ruby/object:Gem::Dependency
70
56
  name: jeweler
71
57
  requirement: !ruby/object:Gem::Requirement
72
58
  requirements:
73
59
  - - "~>"
74
60
  - !ruby/object:Gem::Version
75
- version: 2.0.1
61
+ version: '2.1'
62
+ - - ">="
63
+ - !ruby/object:Gem::Version
64
+ version: 2.1.2
76
65
  type: :development
77
66
  prerelease: false
78
67
  version_requirements: !ruby/object:Gem::Requirement
79
68
  requirements:
80
69
  - - "~>"
81
70
  - !ruby/object:Gem::Version
82
- version: 2.0.1
71
+ version: '2.1'
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: 2.1.2
83
75
  - !ruby/object:Gem::Dependency
84
76
  name: guard
85
77
  requirement: !ruby/object:Gem::Requirement
86
78
  requirements:
87
- - - ">="
79
+ - - "~>"
88
80
  - !ruby/object:Gem::Version
89
- version: '0'
81
+ version: '2.13'
90
82
  type: :development
91
83
  prerelease: false
92
84
  version_requirements: !ruby/object:Gem::Requirement
93
85
  requirements:
94
- - - ">="
86
+ - - "~>"
95
87
  - !ruby/object:Gem::Version
96
- version: '0'
88
+ version: '2.13'
97
89
  - !ruby/object:Gem::Dependency
98
90
  name: guard-rspec
99
91
  requirement: !ruby/object:Gem::Requirement
@@ -132,9 +124,9 @@ extra_rdoc_files:
132
124
  - LICENSE
133
125
  - README.md
134
126
  files:
127
+ - ".github/workflows/ci.yml"
135
128
  - ".rspec"
136
129
  - Gemfile
137
- - Gemfile.lock
138
130
  - Guardfile
139
131
  - LICENSE
140
132
  - README.md
@@ -176,8 +168,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
176
168
  - !ruby/object:Gem::Version
177
169
  version: '0'
178
170
  requirements: []
179
- rubyforge_project:
180
- rubygems_version: 2.4.8
171
+ rubygems_version: 3.1.6
181
172
  signing_key:
182
173
  specification_version: 4
183
174
  summary: ruby interface to passenger-status
data/Gemfile.lock DELETED
@@ -1,124 +0,0 @@
1
- GEM
2
- remote: http://rubygems.org/
3
- specs:
4
- addressable (2.4.0)
5
- aws-sdk (2.2.24)
6
- aws-sdk-resources (= 2.2.24)
7
- aws-sdk-core (2.2.24)
8
- jmespath (~> 1.0)
9
- aws-sdk-resources (2.2.24)
10
- aws-sdk-core (= 2.2.24)
11
- builder (3.2.2)
12
- byebug (8.2.2)
13
- coderay (1.1.1)
14
- crack (0.4.3)
15
- safe_yaml (~> 1.0.0)
16
- descendants_tracker (0.0.4)
17
- thread_safe (~> 0.3, >= 0.3.1)
18
- diff-lcs (1.2.5)
19
- faraday (0.9.2)
20
- multipart-post (>= 1.2, < 3)
21
- ffi (1.9.10)
22
- formatador (0.2.5)
23
- git (1.3.0)
24
- github_api (0.13.1)
25
- addressable (~> 2.4.0)
26
- descendants_tracker (~> 0.0.4)
27
- faraday (~> 0.8, < 0.10)
28
- hashie (>= 3.4)
29
- multi_json (>= 1.7.5, < 2.0)
30
- oauth2
31
- guard (2.13.0)
32
- formatador (>= 0.2.4)
33
- listen (>= 2.7, <= 4.0)
34
- lumberjack (~> 1.0)
35
- nenv (~> 0.1)
36
- notiffany (~> 0.0)
37
- pry (>= 0.9.12)
38
- shellany (~> 0.0)
39
- thor (>= 0.18.1)
40
- guard-compat (1.2.1)
41
- guard-rspec (4.6.4)
42
- guard (~> 2.1)
43
- guard-compat (~> 1.1)
44
- rspec (>= 2.99.0, < 4.0)
45
- hashie (3.4.3)
46
- highline (1.7.8)
47
- jeweler (2.0.1)
48
- builder
49
- bundler (>= 1.0)
50
- git (>= 1.2.5)
51
- github_api
52
- highline (>= 1.6.15)
53
- nokogiri (>= 1.5.10)
54
- rake
55
- rdoc
56
- jmespath (1.1.3)
57
- json (1.8.3)
58
- jwt (1.5.1)
59
- listen (3.0.6)
60
- rb-fsevent (>= 0.9.3)
61
- rb-inotify (>= 0.9.7)
62
- lumberjack (1.0.10)
63
- method_source (0.8.2)
64
- mini_portile2 (2.0.0)
65
- multi_json (1.11.2)
66
- multi_xml (0.5.5)
67
- multipart-post (2.0.0)
68
- nenv (0.3.0)
69
- nokogiri (1.6.7.2)
70
- mini_portile2 (~> 2.0.0.rc2)
71
- notiffany (0.0.8)
72
- nenv (~> 0.1)
73
- shellany (~> 0.0)
74
- oauth2 (1.1.0)
75
- faraday (>= 0.8, < 0.10)
76
- jwt (~> 1.0, < 1.5.2)
77
- multi_json (~> 1.3)
78
- multi_xml (~> 0.5)
79
- rack (>= 1.2, < 3)
80
- pry (0.10.3)
81
- coderay (~> 1.1.0)
82
- method_source (~> 0.8.1)
83
- slop (~> 3.4)
84
- rack (1.6.4)
85
- rake (10.5.0)
86
- rb-fsevent (0.9.7)
87
- rb-inotify (0.9.7)
88
- ffi (>= 0.5.0)
89
- rdoc (4.2.2)
90
- json (~> 1.4)
91
- rspec (3.4.0)
92
- rspec-core (~> 3.4.0)
93
- rspec-expectations (~> 3.4.0)
94
- rspec-mocks (~> 3.4.0)
95
- rspec-core (3.4.3)
96
- rspec-support (~> 3.4.0)
97
- rspec-expectations (3.4.0)
98
- diff-lcs (>= 1.2.0, < 2.0)
99
- rspec-support (~> 3.4.0)
100
- rspec-mocks (3.4.1)
101
- diff-lcs (>= 1.2.0, < 2.0)
102
- rspec-support (~> 3.4.0)
103
- rspec-support (3.4.1)
104
- safe_yaml (1.0.4)
105
- shellany (0.0.1)
106
- slop (3.6.0)
107
- thor (0.19.1)
108
- thread_safe (0.3.5)
109
-
110
- PLATFORMS
111
- ruby
112
-
113
- DEPENDENCIES
114
- aws-sdk
115
- bundler (~> 1.0)
116
- byebug
117
- crack
118
- guard
119
- guard-rspec
120
- jeweler (~> 2.0.1)
121
- rspec
122
-
123
- BUNDLED WITH
124
- 1.11.2