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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c6d857be04b5d7b819a749d04a0ee720475e6c52
4
- data.tar.gz: 7bb635cb8d75c941e9260ca8078e9505e377cfac
3
+ metadata.gz: 7206a30bbf4d5e2c582cafb7e797654dcc88b64c
4
+ data.tar.gz: 8dcccf75dabddc8a4951daa19a6a2392e9091cf1
5
5
  SHA512:
6
- metadata.gz: 9c3f1d237223602ae1989433db8f31fda2c5b8062a861a4fe06b28a7a58446141a3070849d13924f3db8926df5060e5853dcdece7fa51666e70aa098754f8f9c
7
- data.tar.gz: 081c290770485a39e4b47c4f72d6edbe42387ab07509a8969baead136168fa5dba5c17d6725ca663d5322c3f925d1edb7e7cc203668d321ebbecbc974a6a9caa
6
+ metadata.gz: 3ac6485b4f6e46160e413df8011ff76562ec27fa44bc0ce6527b65e440ca620a8f6ee2131481f2854408b8392d93b66f6ca3599110205fa5c066453845cd2312
7
+ data.tar.gz: 1563aa9481647d760cb59b226e7e86cf938c245450cf5f0ee931689e33add43b8b777a0fcb4a84f3f1fda6137a64211e22b72c0590d27d810aa4241c857c1f95
data/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ # SnowAgent
2
+
3
+ Version 0.0.2 - 2015.02.22
4
+ - Count only GET-requests
5
+
6
+ Version 0.0.1 - 2015.02.05
7
+ - Initial release
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2015 Artyom Keydunov
1
+ Copyright (c) 2015 Artyom Keydunov, Alexey Vakhov
2
2
 
3
3
  MIT License
4
4
 
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # SnowAgent
2
2
 
3
- TODO: Write a gem description
3
+ [![Gem Version](https://badge.fury.io/rb/snowagent.svg)](http://badge.fury.io/rb/snowagent) [![Build Status](https://travis-ci.org/snowman-io/snowagent.svg)](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
@@ -1,22 +1,15 @@
1
- require "rails/railtie"
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
- # TODO: don't send these metrics so frequent and so ugly
18
- #SnowAgent.metric("controlles", ApplicationController.subclasses.size, :controllers)
19
- #SnowAgent.metric("models", ActiveRecord::Base.subclasses.size, :models)
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
@@ -1,3 +1,3 @@
1
1
  module SnowAgent
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
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 = `git ls-files -z`.split("\x0")
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.1
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-05 00:00:00.000000000 Z
12
+ date: 2015-02-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
- name: rails
15
+ name: bundler
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - ">="
18
+ - - "~>"
19
19
  - !ruby/object:Gem::Version
20
- version: '0'
21
- type: :runtime
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: '0'
27
+ version: '1.7'
28
28
  - !ruby/object:Gem::Dependency
29
- name: bundler
29
+ name: rake
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
32
  - - "~>"
33
33
  - !ruby/object:Gem::Version
34
- version: '1.7'
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: '1.7'
41
+ version: '10.0'
42
42
  - !ruby/object:Gem::Dependency
43
- name: rake
43
+ name: rspec
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
46
  - - "~>"
47
47
  - !ruby/object:Gem::Version
48
- version: '10.0'
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: '10.0'
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
- - ".gitignore"
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.4.5
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
@@ -1,14 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /Gemfile.lock
4
- /_yardoc/
5
- /coverage/
6
- /doc/
7
- /pkg/
8
- /spec/reports/
9
- /tmp/
10
- *.bundle
11
- *.so
12
- *.o
13
- *.a
14
- mkmf.log
data/Gemfile DELETED
@@ -1,5 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in snowagent.gemspec
4
- gem 'pry'
5
- gemspec
data/Rakefile DELETED
@@ -1,2 +0,0 @@
1
- require "bundler/gem_tasks"
2
-