snowagent 0.0.1 → 0.0.2
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 +4 -4
- data/CHANGELOG.md +7 -0
- data/LICENSE.txt +1 -1
- data/README.md +1 -1
- data/lib/snowagent.rb +6 -1
- data/lib/snowagent/railtie.rb +6 -13
- data/lib/snowagent/version.rb +1 -1
- data/snowagent.gemspec +3 -2
- metadata +17 -18
- data/.gitignore +0 -14
- data/Gemfile +0 -5
- data/Rakefile +0 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7206a30bbf4d5e2c582cafb7e797654dcc88b64c
|
4
|
+
data.tar.gz: 8dcccf75dabddc8a4951daa19a6a2392e9091cf1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ac6485b4f6e46160e413df8011ff76562ec27fa44bc0ce6527b65e440ca620a8f6ee2131481f2854408b8392d93b66f6ca3599110205fa5c066453845cd2312
|
7
|
+
data.tar.gz: 1563aa9481647d760cb59b226e7e86cf938c245450cf5f0ee931689e33add43b8b777a0fcb4a84f3f1fda6137a64211e22b72c0590d27d810aa4241c857c1f95
|
data/CHANGELOG.md
ADDED
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# SnowAgent
|
2
2
|
|
3
|
-
|
3
|
+
[](http://badge.fury.io/rb/snowagent) [](https://travis-ci.org/snowman-io/snowagent)
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
data/lib/snowagent.rb
CHANGED
@@ -3,7 +3,6 @@ require 'uri'
|
|
3
3
|
require 'logger'
|
4
4
|
|
5
5
|
require "snowagent/version"
|
6
|
-
require "snowagent/railtie"
|
7
6
|
require "snowagent/agent"
|
8
7
|
require "snowagent/async_strategy"
|
9
8
|
require "snowagent/sync_strategy"
|
@@ -11,6 +10,12 @@ require "snowagent/sender"
|
|
11
10
|
require "snowagent/service"
|
12
11
|
require "snowagent/configuration"
|
13
12
|
|
13
|
+
begin
|
14
|
+
require "rails/railtie"
|
15
|
+
require "snowagent/railtie"
|
16
|
+
rescue LoadError
|
17
|
+
end
|
18
|
+
|
14
19
|
module SnowAgent
|
15
20
|
class << self
|
16
21
|
attr_writer :configuration
|
data/lib/snowagent/railtie.rb
CHANGED
@@ -1,22 +1,15 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
# This module loading only for Rails apps
|
3
2
|
module SnowAgent
|
4
3
|
class Railtie < Rails::Railtie
|
5
4
|
initializer "snowagent.subscribe_notifications" do
|
6
5
|
ActiveSupport::Notifications.subscribe /process_action.action_controller/ do |*args|
|
7
6
|
event = ActiveSupport::Notifications::Event.new(*args)
|
8
|
-
controller = event.payload[:controller]
|
9
|
-
action = event.payload[:action]
|
10
|
-
duration = event.duration/1000.0
|
11
|
-
|
12
|
-
# Send only 'request' metric for now
|
13
|
-
|
14
|
-
#SnowAgent.metric("#{controller}##{action}.total_time", duration, :specific_request)
|
15
|
-
SnowAgent.metric("request", duration, :request)
|
16
7
|
|
17
|
-
#
|
18
|
-
|
19
|
-
|
8
|
+
# Count only `html` GET requets
|
9
|
+
if event.payload[:method] == "GET" && event.payload[:format] == :html
|
10
|
+
duration = event.duration/1000.0
|
11
|
+
SnowAgent.metric("request", duration, :request)
|
12
|
+
end
|
20
13
|
end
|
21
14
|
end
|
22
15
|
end
|
data/lib/snowagent/version.rb
CHANGED
data/snowagent.gemspec
CHANGED
@@ -13,12 +13,13 @@ Gem::Specification.new do |spec|
|
|
13
13
|
spec.homepage = ""
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
|
-
spec.files =
|
16
|
+
spec.files = Dir['{bin/*,lib/**/*}'] +
|
17
|
+
%w(LICENSE.txt README.md CHANGELOG.md snowagent.gemspec)
|
17
18
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
19
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
20
|
spec.require_paths = ["lib"]
|
20
21
|
|
21
|
-
spec.add_dependency "rails"
|
22
22
|
spec.add_development_dependency "bundler", "~> 1.7"
|
23
23
|
spec.add_development_dependency "rake", "~> 10.0"
|
24
|
+
spec.add_development_dependency "rspec", "~> 3.1"
|
24
25
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: snowagent
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexey Vakhov
|
@@ -9,50 +9,50 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-02-
|
12
|
+
date: 2015-02-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
name:
|
15
|
+
name: bundler
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- - "
|
18
|
+
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: '
|
21
|
-
type: :
|
20
|
+
version: '1.7'
|
21
|
+
type: :development
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
|
-
- - "
|
25
|
+
- - "~>"
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: '
|
27
|
+
version: '1.7'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
|
-
name:
|
29
|
+
name: rake
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
32
|
- - "~>"
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: '
|
34
|
+
version: '10.0'
|
35
35
|
type: :development
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
39
|
- - "~>"
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version: '
|
41
|
+
version: '10.0'
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
|
-
name:
|
43
|
+
name: rspec
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
46
|
- - "~>"
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version: '
|
48
|
+
version: '3.1'
|
49
49
|
type: :development
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
53
|
- - "~>"
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version: '
|
55
|
+
version: '3.1'
|
56
56
|
description: Send metrics to snowman
|
57
57
|
email:
|
58
58
|
- artyom.keydunov@gmail.com
|
@@ -60,11 +60,9 @@ executables: []
|
|
60
60
|
extensions: []
|
61
61
|
extra_rdoc_files: []
|
62
62
|
files:
|
63
|
-
-
|
64
|
-
- Gemfile
|
63
|
+
- CHANGELOG.md
|
65
64
|
- LICENSE.txt
|
66
65
|
- README.md
|
67
|
-
- Rakefile
|
68
66
|
- lib/snowagent.rb
|
69
67
|
- lib/snowagent/agent.rb
|
70
68
|
- lib/snowagent/async_strategy.rb
|
@@ -95,8 +93,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
95
93
|
version: '0'
|
96
94
|
requirements: []
|
97
95
|
rubyforge_project:
|
98
|
-
rubygems_version: 2.
|
96
|
+
rubygems_version: 2.2.2
|
99
97
|
signing_key:
|
100
98
|
specification_version: 4
|
101
99
|
summary: Send metrics to snowman
|
102
100
|
test_files: []
|
101
|
+
has_rdoc:
|
data/.gitignore
DELETED
data/Gemfile
DELETED
data/Rakefile
DELETED