passenger-metrics 0.0.2 → 0.0.3

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
  SHA1:
3
- metadata.gz: 19607add3c1eba0885de2cd4b357cd2a2fdaaaec
4
- data.tar.gz: 7d09e2131b6d75357ded041bad405de8cd325991
3
+ metadata.gz: 54404e24e9777f11f5a0febd4ece203491962579
4
+ data.tar.gz: 66e6a92edde405377dfa753e452a6cf894f02028
5
5
  SHA512:
6
- metadata.gz: 08c213d38ecbce23c589b543e009d5bf7ebd57d7411e68f6c27daf22f226d2b8f56cbf94bad4345c21d629d709563f30906cddc8609e467a24760f9dc8872913
7
- data.tar.gz: 9ca01bd3bf795a4eab1ac59d58b3d3a342ea11a37f7a885ee133806d829fb6e02ed203a29468d57f71a5ae1e96f200935296a5cf9b83f147f72c7ffe7cd4b9b9
6
+ metadata.gz: b95fce3e3589cecd4636b8665c942cea2fa9b82e34228abe8145d4cab846c38ecc33735af36dacf956cb488ec97c4c5a63aab0047dc85724ce3cbd7cc6ff6ee6
7
+ data.tar.gz: f94261b4f8177d68313ab6fdb0a1d62c89b5fb96b52ab04620153275a52a47b014c89dab8c47c41a8e56b276c296e1d12d9d0d5af1887afcb2dac2fd8c46453f
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.2
1
+ 0.0.3
@@ -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
@@ -5,6 +5,10 @@ module PassengerMetrics
5
5
  def self.status
6
6
  @status ||= PassengerMetrics::Status.new
7
7
  end
8
+
9
+ def self.instance_id
10
+ @instance_id ||= Net::HTTP.get( URI.parse('http://169.254.169.254/latest/meta-data/instance-id' ) )
11
+ end
8
12
  end
9
13
 
10
14
  require 'passenger-metrics/metrics/base'
@@ -2,16 +2,16 @@
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.3 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "passenger-metrics"
9
- s.version = "0.0.2"
9
+ s.version = "0.0.3"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
13
13
  s.authors = ["Nathan Woodhull"]
14
- s.date = "2016-03-09"
14
+ s.date = "2016-03-10"
15
15
  s.description = "Get passenger metrics from passenger-status into the analytics tool of your choice."
16
16
  s.email = "nathan@gcontrolshiftlabs.com"
17
17
  s.executables = ["passenger-metrics-cloudwatch"]
metadata CHANGED
@@ -1,14 +1,14 @@
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.3
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: 2016-03-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: crack