ad_agent 0.0.5 → 0.0.6

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.
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in ad_agent.gemspec
4
+ gemspec
@@ -0,0 +1,17 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ ad_agent (0.0.1)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ rake (10.0.4)
10
+
11
+ PLATFORMS
12
+ x86-mingw32
13
+
14
+ DEPENDENCIES
15
+ ad_agent!
16
+ bundler (~> 1.3)
17
+ rake
@@ -0,0 +1,24 @@
1
+ Copyright (c) 2013
2
+ D:\dev\ad-agent-ror>D:\programs\Git\bin\git.exe config user.name
3
+ Volodymyr Sorokin
4
+
5
+ MIT License
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining
8
+ a copy of this software and associated documentation files (the
9
+ "Software"), to deal in the Software without restriction, including
10
+ without limitation the rights to use, copy, modify, merge, publish,
11
+ distribute, sublicense, and/or sell copies of the Software, and to
12
+ permit persons to whom the Software is furnished to do so, subject to
13
+ the following conditions:
14
+
15
+ The above copyright notice and this permission notice shall be
16
+ included in all copies or substantial portions of the Software.
17
+
18
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
22
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
23
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,29 @@
1
+ # AdAgent
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'ad_agent'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install ad_agent
18
+
19
+ ## Usage
20
+
21
+ TODO: Write usage instructions here
22
+
23
+ ## Contributing
24
+
25
+ 1. Fork it
26
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
27
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
28
+ 4. Push to the branch (`git push origin my-new-feature`)
29
+ 5. Create new Pull Request
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,27 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'ad_agent/version'
5
+ require 'rake'
6
+
7
+ Gem::Specification.new do |spec|
8
+ spec.name = "ad_agent"
9
+ spec.version = AdAgent::VERSION
10
+ spec.authors = ["Volodymyr Sorokin"]
11
+ spec.email = ["sorrro@gmail.com"]
12
+ spec.description = "ad_agent"
13
+ spec.summary = "ad_agent"
14
+ spec.homepage = ""
15
+ spec.license = "MIT"
16
+
17
+ spec.files = FileList['lib/**/*.rb', 'bin/*', '[A-Z]*', 'test/**/*'].to_a
18
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
19
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
20
+ spec.require_paths = ["lib"]
21
+
22
+ spec.add_development_dependency "bundler", "~> 1.3"
23
+ spec.add_development_dependency "rake"
24
+
25
+ spec.add_runtime_dependency 'aquarium', '>= 0.5.1'
26
+ spec.add_runtime_dependency 'activesupport', '>= 3.2.13'
27
+ end
@@ -1,20 +1,22 @@
1
- require 'aquarium'
2
- require 'active_support'
3
-
4
- include Aquarium::DSL
5
- include Aquarium::Aspects
6
-
7
- puts 'Starting adagent...'
8
-
9
- ActiveSupport::Notifications.subscribe do |name, start, finish, id, payload|
10
- Rails.logger.debug(["NOTIFICATION:", name, start, finish, payload].join(' '))
11
- end
12
-
13
- Aspect.new :around, :method_options => [:exclude_ancestor_methods], :on_types => %r(.*Controller) do |join_point, object, *args|
14
- p "Entering: #{join_point.target_type.name}##{join_point.method_name} for object #{object}"
15
- result = join_point.proceed
16
- p "Leaving: #{join_point.target_type.name}##{join_point.method_name} for object #{object}"
17
- result # block needs to return the result of the "proceed"!
18
- end
19
-
20
- puts 'Adagent started'
1
+ module AdAgent
2
+ require_relative "ad_agent/version"
3
+ require_relative "ad_agent/ad_agent_aquarium"
4
+ require_relative "ad_agent/ad_agent_notifications"
5
+
6
+ @logger = Logger.new(STDOUT)
7
+
8
+ @logger.info "[ADAGENT] Initializing AdAgent-#{AdAgent::VERSION}"
9
+
10
+ if defined?(Rails) and Rails.respond_to?(:version) and Rails.version =~ /^3/
11
+ class AdAgentRailtie < Rails::Railtie
12
+ initializer "ad_agent.start" do |app|
13
+ AdAgent::initNotifications
14
+ AdAgent::initAop
15
+ end
16
+ end
17
+ else
18
+ AdAgent::initNotifications
19
+ AdAgent::initAop
20
+ end
21
+
22
+ end
@@ -0,0 +1,23 @@
1
+ module AdAgent
2
+ require 'aquarium'
3
+
4
+ include Aquarium::DSL
5
+ include Aquarium::Aspects
6
+
7
+ def self.initAop
8
+ @logger.debug '[ADAGENT] Initializing Aquarium Aspects'
9
+
10
+ add_aspect('PostsController')
11
+ add_aspect('ActionController')
12
+ end
13
+
14
+ def self.add_aspect(class_name)
15
+ Aspect.new :around, :calls_to => :all_methods, :method_options => [:exclude_ancestor_methods],
16
+ :on_types => class_name do |join_point, object, *args|
17
+ @logger.info "[ADAGENT] AOP-Entering: #{join_point.target_type.name}##{join_point.method_name} for object #{object}, with args: #{args}"
18
+ result = join_point.proceed
19
+ @logger.info "[ADAGENT] AOP-Leaving: #{join_point.target_type.name}##{join_point.method_name} for object #{object}, with args: #{args}"
20
+ result # block needs to return the result of the "proceed"!
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,10 @@
1
+ module AdAgent
2
+ require 'active_support'
3
+
4
+ def self.initNotifications
5
+ @logger.debug '[ADAGENT] Initializing Active Support Notification'
6
+ ActiveSupport::Notifications.subscribe do |name, start, finish, id, payload|
7
+ @logger.info "[ADAGENT] AS-Notification: #{name} #{start} #{finish} #{payload}"
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,3 @@
1
+ module AdAgent
2
+ VERSION = "0.0.6"
3
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ad_agent
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,8 +9,40 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-16 00:00:00.000000000 Z
12
+ date: 2013-05-24 00:00:00.000000000 Z
13
13
  dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: bundler
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: '1.3'
22
+ type: :development
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: '1.3'
30
+ - !ruby/object:Gem::Dependency
31
+ name: rake
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ type: :development
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
14
46
  - !ruby/object:Gem::Dependency
15
47
  name: aquarium
16
48
  requirement: !ruby/object:Gem::Requirement
@@ -43,15 +75,27 @@ dependencies:
43
75
  - - ! '>='
44
76
  - !ruby/object:Gem::Version
45
77
  version: 3.2.13
46
- description: A simple Hello World RoR Application Diagnostics Agent
47
- email: volodymyr_sorokin_cw@bmc.com
78
+ description: ad_agent
79
+ email:
80
+ - sorrro@gmail.com
48
81
  executables: []
49
82
  extensions: []
50
83
  extra_rdoc_files: []
51
84
  files:
85
+ - lib/ad_agent/ad_agent_aquarium.rb
86
+ - lib/ad_agent/ad_agent_notifications.rb
87
+ - lib/ad_agent/version.rb
52
88
  - lib/ad_agent.rb
53
- homepage:
54
- licenses: []
89
+ - ad_agent-0.0.6.gem
90
+ - ad_agent.gemspec
91
+ - Gemfile
92
+ - Gemfile.lock
93
+ - LICENSE.txt
94
+ - Rakefile
95
+ - README.md
96
+ homepage: ''
97
+ licenses:
98
+ - MIT
55
99
  post_install_message:
56
100
  rdoc_options: []
57
101
  require_paths:
@@ -73,5 +117,5 @@ rubyforge_project:
73
117
  rubygems_version: 1.8.24
74
118
  signing_key:
75
119
  specification_version: 3
76
- summary: RoR Application Diagnostics Agent
120
+ summary: ad_agent
77
121
  test_files: []