pmetric 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.circleci/config.yml +43 -0
- data/.gitignore +10 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/Appraisals +7 -0
- data/CHANGELOG.md +15 -0
- data/Gemfile +4 -0
- data/README.md +5 -0
- data/Rakefile +9 -0
- data/bin/console +14 -0
- data/gemfiles/.bundle/config +2 -0
- data/gemfiles/activesupport_3.gemfile +7 -0
- data/gemfiles/activesupport_3.gemfile.lock +54 -0
- data/gemfiles/activesupport_5.gemfile +7 -0
- data/gemfiles/activesupport_5.gemfile.lock +60 -0
- data/lib/pmetric.rb +80 -0
- data/lib/pmetric/collector.rb +30 -0
- data/lib/pmetric/collector/base.rb +13 -0
- data/lib/pmetric/collector/influx.rb +80 -0
- data/lib/pmetric/collector/noop.rb +9 -0
- data/lib/pmetric/configuration.rb +95 -0
- data/lib/pmetric/testing.rb +14 -0
- data/lib/pmetric/version.rb +3 -0
- data/pmetric.gemspec +31 -0
- metadata +171 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: ea593f2604d125f5fb39a86cf5e55c25ceb97e61
|
4
|
+
data.tar.gz: bfaaf37ad9283de7dbcb470a56d82b49b69107ed
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b3955a0c022a49be9fd75f86511b821ca826acd923b95aac78c657a178e56ac00c7287ec6b575d2bc4f6ea5e2af7f4475476ebfce8161c4476fa16d0b8e3474e
|
7
|
+
data.tar.gz: e21eaae9c82fe9b88b612b8bcfb280685c3e8344178a56d2d32cc97da65119eba2485eaeb35b550946058a8c0a2988668709ea6ce5b7b8e77340a86018b03d94
|
@@ -0,0 +1,43 @@
|
|
1
|
+
version: 2
|
2
|
+
jobs:
|
3
|
+
build:
|
4
|
+
working_directory: ~/pmetric
|
5
|
+
|
6
|
+
docker:
|
7
|
+
- image: ruby:2.2.4
|
8
|
+
|
9
|
+
environment:
|
10
|
+
BUNDLE_PATH: "vendor/bundle"
|
11
|
+
|
12
|
+
steps:
|
13
|
+
- checkout
|
14
|
+
- run: gem install bundler
|
15
|
+
|
16
|
+
# Restore bundle cache
|
17
|
+
- type: cache-restore
|
18
|
+
key: pmetric-2.2.4-{{ checksum "pmetric.gemspec" }}
|
19
|
+
|
20
|
+
# Bundle install dependencies
|
21
|
+
- run: bundle install
|
22
|
+
|
23
|
+
# Install appraisal
|
24
|
+
- run: bundle exec appraisal install
|
25
|
+
|
26
|
+
# Store bundle cache
|
27
|
+
- type: cache-save
|
28
|
+
key: pmetric-2.2.4-{{ checksum "pmetric.gemspec" }}
|
29
|
+
paths:
|
30
|
+
- vendor/bundle
|
31
|
+
|
32
|
+
# Run rspec in parallel
|
33
|
+
- type: shell
|
34
|
+
command: |
|
35
|
+
bundle exec appraisal rspec --profile 10 \
|
36
|
+
--format RspecJunitFormatter \
|
37
|
+
--out /tmp/test-results/rspec.xml \
|
38
|
+
--format progress \
|
39
|
+
$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)
|
40
|
+
|
41
|
+
# Save artifacts
|
42
|
+
- type: store_test_results
|
43
|
+
path: /tmp/test-results
|
data/.gitignore
ADDED
data/.ruby-gemset
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
prism_d
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.2.4
|
data/Appraisals
ADDED
data/CHANGELOG.md
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
# PMetric Changelog
|
2
|
+
|
3
|
+
All notable changes to this project will be documented in this file.
|
4
|
+
|
5
|
+
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
6
|
+
and this project adheres to [Semantic Versioning](http://semver.org/).
|
7
|
+
|
8
|
+
## [Unreleased]
|
9
|
+
|
10
|
+
## [1.0.0] - 2017-06-05
|
11
|
+
|
12
|
+
Initial Release!
|
13
|
+
|
14
|
+
[Unreleased]: https://github.com/500friends/pmetric/compare/v1.0.0...HEAD
|
15
|
+
[1.0.0]: https://github.com/500friends/pmetric/tree/v1.0.0
|
data/Gemfile
ADDED
data/README.md
ADDED
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "pmetric"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
@@ -0,0 +1,54 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ..
|
3
|
+
specs:
|
4
|
+
pmetric (0.1.0)
|
5
|
+
activesupport (>= 3.2.22, < 6)
|
6
|
+
influxdb (~> 0.3.14)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
activesupport (3.2.22.4)
|
12
|
+
i18n (~> 0.6, >= 0.6.4)
|
13
|
+
multi_json (~> 1.0)
|
14
|
+
appraisal (2.2.0)
|
15
|
+
bundler
|
16
|
+
rake
|
17
|
+
thor (>= 0.14.0)
|
18
|
+
cause (0.1)
|
19
|
+
diff-lcs (1.3)
|
20
|
+
i18n (0.8.4)
|
21
|
+
influxdb (0.3.14)
|
22
|
+
cause
|
23
|
+
json
|
24
|
+
json (2.1.0)
|
25
|
+
multi_json (1.12.1)
|
26
|
+
rake (10.5.0)
|
27
|
+
rspec (3.6.0)
|
28
|
+
rspec-core (~> 3.6.0)
|
29
|
+
rspec-expectations (~> 3.6.0)
|
30
|
+
rspec-mocks (~> 3.6.0)
|
31
|
+
rspec-core (3.6.0)
|
32
|
+
rspec-support (~> 3.6.0)
|
33
|
+
rspec-expectations (3.6.0)
|
34
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
35
|
+
rspec-support (~> 3.6.0)
|
36
|
+
rspec-mocks (3.6.0)
|
37
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
38
|
+
rspec-support (~> 3.6.0)
|
39
|
+
rspec-support (3.6.0)
|
40
|
+
thor (0.19.4)
|
41
|
+
|
42
|
+
PLATFORMS
|
43
|
+
ruby
|
44
|
+
|
45
|
+
DEPENDENCIES
|
46
|
+
activesupport (= 3.2.22.4)
|
47
|
+
appraisal
|
48
|
+
bundler (~> 1.13)
|
49
|
+
pmetric!
|
50
|
+
rake (~> 10.0)
|
51
|
+
rspec (~> 3.0)
|
52
|
+
|
53
|
+
BUNDLED WITH
|
54
|
+
1.15.0
|
@@ -0,0 +1,60 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ..
|
3
|
+
specs:
|
4
|
+
pmetric (0.1.0)
|
5
|
+
activesupport (>= 3.2.22, < 6)
|
6
|
+
influxdb (~> 0.3.14)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
activesupport (5.1.1)
|
12
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
13
|
+
i18n (~> 0.7)
|
14
|
+
minitest (~> 5.1)
|
15
|
+
tzinfo (~> 1.1)
|
16
|
+
appraisal (2.2.0)
|
17
|
+
bundler
|
18
|
+
rake
|
19
|
+
thor (>= 0.14.0)
|
20
|
+
cause (0.1)
|
21
|
+
concurrent-ruby (1.0.5)
|
22
|
+
diff-lcs (1.3)
|
23
|
+
i18n (0.8.4)
|
24
|
+
influxdb (0.3.14)
|
25
|
+
cause
|
26
|
+
json
|
27
|
+
json (2.1.0)
|
28
|
+
minitest (5.10.2)
|
29
|
+
rake (10.5.0)
|
30
|
+
rspec (3.6.0)
|
31
|
+
rspec-core (~> 3.6.0)
|
32
|
+
rspec-expectations (~> 3.6.0)
|
33
|
+
rspec-mocks (~> 3.6.0)
|
34
|
+
rspec-core (3.6.0)
|
35
|
+
rspec-support (~> 3.6.0)
|
36
|
+
rspec-expectations (3.6.0)
|
37
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
38
|
+
rspec-support (~> 3.6.0)
|
39
|
+
rspec-mocks (3.6.0)
|
40
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
41
|
+
rspec-support (~> 3.6.0)
|
42
|
+
rspec-support (3.6.0)
|
43
|
+
thor (0.19.4)
|
44
|
+
thread_safe (0.3.6)
|
45
|
+
tzinfo (1.2.3)
|
46
|
+
thread_safe (~> 0.1)
|
47
|
+
|
48
|
+
PLATFORMS
|
49
|
+
ruby
|
50
|
+
|
51
|
+
DEPENDENCIES
|
52
|
+
activesupport (>= 5.0)
|
53
|
+
appraisal
|
54
|
+
bundler (~> 1.13)
|
55
|
+
pmetric!
|
56
|
+
rake (~> 10.0)
|
57
|
+
rspec (~> 3.0)
|
58
|
+
|
59
|
+
BUNDLED WITH
|
60
|
+
1.15.0
|
data/lib/pmetric.rb
ADDED
@@ -0,0 +1,80 @@
|
|
1
|
+
require 'pmetric/configuration'
|
2
|
+
require 'pmetric/collector'
|
3
|
+
require 'yaml'
|
4
|
+
|
5
|
+
module PMetric
|
6
|
+
CONFIGURE_MUTEX ||= Mutex.new
|
7
|
+
|
8
|
+
# Enables metric collection by setting the collector to `:influx`
|
9
|
+
def self.enable!
|
10
|
+
configure { |c| c.collector = :influx }
|
11
|
+
end
|
12
|
+
|
13
|
+
# Disables metric collection by setting the collector to `:noop`
|
14
|
+
def self.disable!
|
15
|
+
configure { |c| c.collector = :noop }
|
16
|
+
end
|
17
|
+
|
18
|
+
# Returns and caches the global collector.
|
19
|
+
#
|
20
|
+
# @return [PMetric::Collector::Base]
|
21
|
+
def self.collector
|
22
|
+
Thread.main[:pmetric_collector] ||= Collector.build(config)
|
23
|
+
end
|
24
|
+
|
25
|
+
# Returns the global configuration.
|
26
|
+
#
|
27
|
+
# Do not set values on this object. Use `#configure` instead.
|
28
|
+
#
|
29
|
+
# @return [PMetric::Configuration]
|
30
|
+
def self.config
|
31
|
+
Thread.main[:pmetric_config] ||= Configuration.new
|
32
|
+
end
|
33
|
+
|
34
|
+
# Yields the configuration for the current thread.
|
35
|
+
#
|
36
|
+
# @yield [PMetric::Configuration]
|
37
|
+
def self.configure
|
38
|
+
CONFIGURE_MUTEX.synchronize { yield config }
|
39
|
+
end
|
40
|
+
|
41
|
+
# Delegates to {PMetric.collector}. Collectors will add the `value: 1` field
|
42
|
+
# on their own, so passing it here will be overridden later.
|
43
|
+
#
|
44
|
+
# @param metric [String] the item/event being measured
|
45
|
+
# @param fields [Hash] additional field values to be recorded
|
46
|
+
# @param tags [Hash] additional tags for this metric
|
47
|
+
def self.increment(metric, fields: {}, tags: {})
|
48
|
+
collector.increment(metric, fields: fields, tags: tags)
|
49
|
+
end
|
50
|
+
|
51
|
+
# Delegates to {PMetric.collector}.
|
52
|
+
#
|
53
|
+
# @param metric [String] the item/event being measured
|
54
|
+
# @param fields [Hash] additional field values to be recorded
|
55
|
+
# @param tags [Hash] additional tags for this metric
|
56
|
+
def self.write(stat, fields:, tags: {})
|
57
|
+
collector.write(stat, fields: fields, tags: tags)
|
58
|
+
end
|
59
|
+
|
60
|
+
# Loads a YAML configuration for the given file/environment.
|
61
|
+
#
|
62
|
+
# @param path [String] The path to the configuration file
|
63
|
+
# @param env [String] The environment to load the configs for.
|
64
|
+
def self.load_config_for_env(path, env)
|
65
|
+
if !File.exists?(path)
|
66
|
+
warn "[#{self.name}] Configuration file does not exist: #{path}"
|
67
|
+
return
|
68
|
+
end
|
69
|
+
|
70
|
+
yaml = Hash(YAML.load_file(path))[env]
|
71
|
+
|
72
|
+
if !yaml
|
73
|
+
warn "[#{self.name}] Environment not configured at #{path}: #{env}"
|
74
|
+
return
|
75
|
+
end
|
76
|
+
|
77
|
+
enable! if yaml['enabled']
|
78
|
+
Hash(yaml['config']).each { |k, v| config.send("#{k}=", v) }
|
79
|
+
end
|
80
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'pmetric/collector/base'
|
2
|
+
require 'pmetric/collector/noop'
|
3
|
+
require 'pmetric/collector/influx'
|
4
|
+
|
5
|
+
module PMetric
|
6
|
+
module Collector
|
7
|
+
# Builds a collector based on the given {PMetric.config} configuration.
|
8
|
+
#
|
9
|
+
# @param config [PMetric::Configuration]
|
10
|
+
# @return [PMetric::Collector::Base]
|
11
|
+
def self.build(config)
|
12
|
+
collector = config.collector
|
13
|
+
case collector.to_sym
|
14
|
+
when :noop then Collector::Noop.new
|
15
|
+
when :influx then build_influx_client(config)
|
16
|
+
else
|
17
|
+
raise "Invalid collector configured: #{collector.inspect}"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
# :nodoc:
|
22
|
+
def self.build_influx_client(config)
|
23
|
+
Collector::Influx.new(
|
24
|
+
opts: config.client_opts,
|
25
|
+
tags: config.default_tags,
|
26
|
+
logger: config.logger
|
27
|
+
)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,80 @@
|
|
1
|
+
module PMetric
|
2
|
+
module Collector
|
3
|
+
# InfluxDB Collector for {Pmetrics}.
|
4
|
+
class Influx < Base
|
5
|
+
PRECISIONS = {
|
6
|
+
's' => Proc.new { Time.now.utc.to_i },
|
7
|
+
'ms' => Proc.new { (Time.now.utc * 1000.0).to_i },
|
8
|
+
'ns' => Proc.new { (Time.now.utc.to_r * 10**9).to_i }
|
9
|
+
}.freeze
|
10
|
+
|
11
|
+
attr_reader :tags, :precision, :opts, :logger
|
12
|
+
|
13
|
+
# @param database [String] InfluxDB database to write to.
|
14
|
+
# @param client_opts [Hash] InfluxDB client options.
|
15
|
+
# @param tags [Hash] Default tags to be added to every event.
|
16
|
+
# @param logger [Logger] InfluxDB client logger. This affects global InfluxDB logging.
|
17
|
+
def initialize(opts: {}, tags: nil, logger: nil)
|
18
|
+
@opts = opts
|
19
|
+
@tags = Hash(tags).freeze
|
20
|
+
@precision = (opts[:time_precision] || 'ns').freeze
|
21
|
+
|
22
|
+
require 'influxdb'
|
23
|
+
InfluxDB::Logging.logger = InfluxLogger.new(logger)
|
24
|
+
end
|
25
|
+
|
26
|
+
# Delegates to {#write}, adding `value: 1` to the fields. Passing
|
27
|
+
# your own `value` field option is pointless here.
|
28
|
+
#
|
29
|
+
# @param metric [String] The item/event being measured.
|
30
|
+
# @param fields [Hash] Additional fields being measured.
|
31
|
+
# @param tags [Hash] Additional tags for the event.
|
32
|
+
def increment(metric, fields: {}, tags: {})
|
33
|
+
fields[:value] = 1
|
34
|
+
write(metric, fields: fields, tags: tags)
|
35
|
+
end
|
36
|
+
|
37
|
+
# Writes metrics to InfluxDB.
|
38
|
+
#
|
39
|
+
# @param metric [String] The item/event being measured.
|
40
|
+
# @param fields [Hash] The fields being measured.
|
41
|
+
# @param tags [Hash] Additional tags for the event.
|
42
|
+
def write(metric, fields:, tags: {})
|
43
|
+
data = {
|
44
|
+
values: fields,
|
45
|
+
tags: tags.merge(@tags),
|
46
|
+
timestamp: PRECISIONS[@precision].call
|
47
|
+
}
|
48
|
+
|
49
|
+
client.write_point(metric, data)
|
50
|
+
end
|
51
|
+
|
52
|
+
private
|
53
|
+
|
54
|
+
def client
|
55
|
+
@client ||= InfluxDB::Client.new(@opts)
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
# Custom InfluxDB logger to set the logging prefix correctly.
|
60
|
+
#
|
61
|
+
# @private
|
62
|
+
# :nodoc:
|
63
|
+
class InfluxLogger
|
64
|
+
def initialize(logger = nil)
|
65
|
+
require 'active_support/tagged_logging'
|
66
|
+
@logger = logger && ActiveSupport::TaggedLogging.new(logger)
|
67
|
+
end
|
68
|
+
|
69
|
+
%i(debug info warn error fatal).each do |level|
|
70
|
+
define_method(level) do |prefix, &block|
|
71
|
+
write(level, prefix, &block)
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
def write(level, prefix, &block)
|
76
|
+
@logger && @logger.tagged(prefix) { |l| l.send(level, &block) }
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
@@ -0,0 +1,95 @@
|
|
1
|
+
module PMetric
|
2
|
+
class Configuration
|
3
|
+
attr_accessor \
|
4
|
+
:collector,
|
5
|
+
:host,
|
6
|
+
:port,
|
7
|
+
:username,
|
8
|
+
:password,
|
9
|
+
:database,
|
10
|
+
:time_precision,
|
11
|
+
:retry,
|
12
|
+
:use_ssl,
|
13
|
+
:logger,
|
14
|
+
:async,
|
15
|
+
:udp_host,
|
16
|
+
:udp_port,
|
17
|
+
:default_tags
|
18
|
+
|
19
|
+
def initialize
|
20
|
+
@host = ENV.fetch('INFLUXDB_HOST', 'influxdb.500friends.com'.freeze)
|
21
|
+
@port = ENV.fetch('INFLUXDB_PORT', 8086)
|
22
|
+
@username = ENV.fetch('INFLUXDB_USERNAME', nil)
|
23
|
+
@password = ENV.fetch('INFLUXDB_PASSWORD', nil)
|
24
|
+
@database = ENV.fetch('INFLUXDB_DATABASE', 'prism'.freeze)
|
25
|
+
@time_precision = 'ns'.freeze
|
26
|
+
@retry = 10
|
27
|
+
@use_ssl = false
|
28
|
+
|
29
|
+
# Logging is off by default
|
30
|
+
@logger = false
|
31
|
+
|
32
|
+
# PMetric must be intentionally enabled
|
33
|
+
@collector = :noop
|
34
|
+
|
35
|
+
# Async options
|
36
|
+
@async = {
|
37
|
+
# InfluxDB async writer uses a custom ruby Queue to keep track of
|
38
|
+
# pending points, and this specifies the max number of items the queue
|
39
|
+
# will allow. Anything greater will just drop off.
|
40
|
+
max_queue_size: 10_000,
|
41
|
+
|
42
|
+
# Number of post points to write at once. For a full queue with a max
|
43
|
+
# size of 10_000, and a max post points of 1_000, it will take 10 batch
|
44
|
+
# calls to post all the data.
|
45
|
+
max_post_points: 1_000,
|
46
|
+
|
47
|
+
# Number of Threads emptying the async queue. This will be per-process,
|
48
|
+
# as the collector is shared globally.
|
49
|
+
num_worker_threads: 2,
|
50
|
+
|
51
|
+
# Time each thread waits to check for new points. The InfluxDB client
|
52
|
+
# will actually sleep at `rand(sleep_interval)`, fyi.
|
53
|
+
sleep_interval: 5
|
54
|
+
}
|
55
|
+
|
56
|
+
# Default to no udp_port. Setting udp_port && udp_host enables UDP on.
|
57
|
+
@udp_host = ENV.fetch('INFLUXDB_UDP_HOST', @host)
|
58
|
+
@udp_port = ENV.fetch('INFLUXDB_UDP_PORT', nil)
|
59
|
+
|
60
|
+
# Default Event Tags
|
61
|
+
@default_tags = nil
|
62
|
+
end
|
63
|
+
|
64
|
+
# Builds client options for the {PMetric::Collector::Influx}
|
65
|
+
# collector.
|
66
|
+
#
|
67
|
+
# @return [Hash] Influx client options.
|
68
|
+
def client_opts
|
69
|
+
opts = {
|
70
|
+
host: @host,
|
71
|
+
port: @port,
|
72
|
+
database: @database,
|
73
|
+
time_precision: @time_precision,
|
74
|
+
retry: @retry
|
75
|
+
}
|
76
|
+
|
77
|
+
opts[:username] = @username if @username
|
78
|
+
opts[:password] = @password if @password
|
79
|
+
|
80
|
+
if @use_ssl
|
81
|
+
opts[:use_ssl] = true
|
82
|
+
opts[:verify_ssl] = true
|
83
|
+
end
|
84
|
+
|
85
|
+
if @udp_host && @udp_port
|
86
|
+
opts[:udp] = { host: @udp_host, port: @udp_port }
|
87
|
+
opts[:async] = false
|
88
|
+
else
|
89
|
+
opts[:async] = @async || false
|
90
|
+
end
|
91
|
+
|
92
|
+
opts
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module PMetric
|
2
|
+
def self.with_clean_env
|
3
|
+
old_config = Thread.main[:pmetric_config]
|
4
|
+
Thread.main[:pmetric_config] = nil
|
5
|
+
|
6
|
+
old_collector = Thread.main[:pmetric_collector]
|
7
|
+
Thread.main[:pmetric_collector] = nil
|
8
|
+
|
9
|
+
yield
|
10
|
+
|
11
|
+
Thread.main[:pmetric_config] = old_config
|
12
|
+
Thread.main[:pmetric_collector] = old_collector
|
13
|
+
end
|
14
|
+
end
|
data/pmetric.gemspec
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'pmetric/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "pmetric"
|
8
|
+
spec.version = PMetric::VERSION
|
9
|
+
spec.authors = ["Braden Schaeffer"]
|
10
|
+
spec.email = ["bschaeffer@merkleinc.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{InfluxDB Metrics for Rails apps.}
|
13
|
+
spec.description = %q{Enables configurable metric collection for Rails apps.}
|
14
|
+
spec.homepage = "https://github.com/500friends/pmetric"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
17
|
+
f.match(%r{^(spec)/})
|
18
|
+
end
|
19
|
+
|
20
|
+
spec.require_paths = ["lib"]
|
21
|
+
|
22
|
+
# Monitoring Gems
|
23
|
+
spec.add_dependency 'influxdb', '~> 0.3.14'
|
24
|
+
spec.add_dependency 'activesupport', '>= 3.2.22', '< 6'
|
25
|
+
|
26
|
+
spec.add_development_dependency 'appraisal'
|
27
|
+
spec.add_development_dependency 'rspec_junit_formatter'
|
28
|
+
spec.add_development_dependency 'bundler', '~> 1.13'
|
29
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
30
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
31
|
+
end
|
metadata
ADDED
@@ -0,0 +1,171 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: pmetric
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Braden Schaeffer
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-06-05 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: influxdb
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.3.14
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.3.14
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: activesupport
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 3.2.22
|
34
|
+
- - "<"
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: '6'
|
37
|
+
type: :runtime
|
38
|
+
prerelease: false
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: 3.2.22
|
44
|
+
- - "<"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '6'
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: appraisal
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '0'
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
name: rspec_junit_formatter
|
63
|
+
requirement: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - ">="
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '0'
|
68
|
+
type: :development
|
69
|
+
prerelease: false
|
70
|
+
version_requirements: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0'
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
name: bundler
|
77
|
+
requirement: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - "~>"
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '1.13'
|
82
|
+
type: :development
|
83
|
+
prerelease: false
|
84
|
+
version_requirements: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - "~>"
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '1.13'
|
89
|
+
- !ruby/object:Gem::Dependency
|
90
|
+
name: rake
|
91
|
+
requirement: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - "~>"
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '10.0'
|
96
|
+
type: :development
|
97
|
+
prerelease: false
|
98
|
+
version_requirements: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - "~>"
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '10.0'
|
103
|
+
- !ruby/object:Gem::Dependency
|
104
|
+
name: rspec
|
105
|
+
requirement: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - "~>"
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '3.0'
|
110
|
+
type: :development
|
111
|
+
prerelease: false
|
112
|
+
version_requirements: !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
114
|
+
- - "~>"
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: '3.0'
|
117
|
+
description: Enables configurable metric collection for Rails apps.
|
118
|
+
email:
|
119
|
+
- bschaeffer@merkleinc.com
|
120
|
+
executables: []
|
121
|
+
extensions: []
|
122
|
+
extra_rdoc_files: []
|
123
|
+
files:
|
124
|
+
- ".circleci/config.yml"
|
125
|
+
- ".gitignore"
|
126
|
+
- ".ruby-gemset"
|
127
|
+
- ".ruby-version"
|
128
|
+
- Appraisals
|
129
|
+
- CHANGELOG.md
|
130
|
+
- Gemfile
|
131
|
+
- README.md
|
132
|
+
- Rakefile
|
133
|
+
- bin/console
|
134
|
+
- gemfiles/.bundle/config
|
135
|
+
- gemfiles/activesupport_3.gemfile
|
136
|
+
- gemfiles/activesupport_3.gemfile.lock
|
137
|
+
- gemfiles/activesupport_5.gemfile
|
138
|
+
- gemfiles/activesupport_5.gemfile.lock
|
139
|
+
- lib/pmetric.rb
|
140
|
+
- lib/pmetric/collector.rb
|
141
|
+
- lib/pmetric/collector/base.rb
|
142
|
+
- lib/pmetric/collector/influx.rb
|
143
|
+
- lib/pmetric/collector/noop.rb
|
144
|
+
- lib/pmetric/configuration.rb
|
145
|
+
- lib/pmetric/testing.rb
|
146
|
+
- lib/pmetric/version.rb
|
147
|
+
- pmetric.gemspec
|
148
|
+
homepage: https://github.com/500friends/pmetric
|
149
|
+
licenses: []
|
150
|
+
metadata: {}
|
151
|
+
post_install_message:
|
152
|
+
rdoc_options: []
|
153
|
+
require_paths:
|
154
|
+
- lib
|
155
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ">="
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
161
|
+
requirements:
|
162
|
+
- - ">="
|
163
|
+
- !ruby/object:Gem::Version
|
164
|
+
version: '0'
|
165
|
+
requirements: []
|
166
|
+
rubyforge_project:
|
167
|
+
rubygems_version: 2.4.8
|
168
|
+
signing_key:
|
169
|
+
specification_version: 4
|
170
|
+
summary: InfluxDB Metrics for Rails apps.
|
171
|
+
test_files: []
|