fiveruns-dash-activerecord 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc ADDED
@@ -0,0 +1,67 @@
1
+ = FiveRuns Dash recipe for ActiveRecord
2
+
3
+ Provides a Ruby API to push metrics from applications using ActiveRecord to the FiveRuns Dash service, http://dash.fiveruns.com, currently in beta.
4
+
5
+ You'll need a Dash account before using this library.
6
+
7
+ == Installation
8
+
9
+ This library is released as a gem from the official repository at http://github.com/fiveruns/dash-activerecord
10
+
11
+ sudo gem install fiveruns-dash-activerecord --source http://gems.github.com
12
+
13
+ == Usage
14
+
15
+ See the Dash Ruby support pages http://support.fiveruns.com/faqs/dash/ruby for information on how to use this library.
16
+
17
+ == Authors
18
+
19
+ The FiveRuns Development Team & Dash community
20
+
21
+ == Dependencies
22
+
23
+ * The fiveruns-dash-ruby gem (see http://github.com/fiveruns/dash-ruby)
24
+ * The json gem (as a dependency for fiveruns-dash-ruby)
25
+
26
+ == Platforms
27
+
28
+ This library has only been tested on OSX and Linux. See the notes for fiveruns-dash-ruby for more information: http://github.com/fiveruns/dash-ruby
29
+
30
+ == Contributing
31
+
32
+ As an open source project, we welcome community contributions!
33
+
34
+ The best way to contribute is by sending pull requests via GitHub. The official repository for this project is:
35
+
36
+ http://github.com/fiveruns/dash-activerecord
37
+
38
+ == Support
39
+
40
+ Please join the dash-users Google group, http://groups.google.com/group/dash-users
41
+
42
+ You can also contact us via Twitter, Campfire, or email; see the main help page, http://support.fiveruns.com, for details.
43
+
44
+ == License
45
+
46
+ # (The FiveRuns License)
47
+ #
48
+ # Copyright (c) 2006-2008 FiveRuns Corporation
49
+ #
50
+ # Permission is hereby granted, free of charge, to any person obtaining
51
+ # a copy of this software and associated documentation files (the
52
+ # 'Software'), to deal in the Software without restriction, including
53
+ # without limitation the rights to use, copy, modify, merge, publish,
54
+ # distribute, sublicense, and/or sell copies of the Software, and to
55
+ # permit persons to whom the Software is furnished to do so, subject to
56
+ # the following conditions:
57
+ #
58
+ # The above copyright notice and this permission notice shall be
59
+ # included in all copies or substantial portions of the Software.
60
+ #
61
+ # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
62
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
63
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
64
+ # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
65
+ # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
66
+ # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
67
+ # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/VERSION.yml ADDED
@@ -0,0 +1,4 @@
1
+ ---
2
+ :patch: 0
3
+ :major: 0
4
+ :minor: 8
@@ -0,0 +1,2 @@
1
+ # Stub for gem dependency schemes
2
+ require 'fiveruns/dash/recipes/activerecord'
@@ -0,0 +1,19 @@
1
+ require 'fiveruns/dash'
2
+
3
+ Fiveruns::Dash.register_recipe :activerecord, :url => 'http://dash.fiveruns.com' do |recipe|
4
+ # We need a way to get the total time for a request/operation so that we can
5
+ # calculate the relative percentage used by AR/DB. Default to "response_time" for the Rails
6
+ # recipe but daemons can set this constant to provide their own total time metric.
7
+ total_time = recipe.options[:ar_total_time] ? recipe.options[:ar_total_time] : "response_time"
8
+
9
+ recipe.time :ar_time, 'ActiveRecord Time', :methods => Fiveruns::Dash::ActiveRecordContext.all_methods, :reentrant => true, :only_within => total_time
10
+ recipe.time :db_time, 'Database Time', :methods => %w(ActiveRecord::ConnectionAdapters::AbstractAdapter#log), :only_within => total_time
11
+
12
+ recipe.percentage :ar_util, 'ActiveRecord Utilization', :sources => ["ar_time", total_time] do |ar_time, all_time|
13
+ all_time == 0 ? 0 : (ar_time / all_time) * 100.0
14
+ end
15
+ recipe.percentage :db_util, 'Database Utilization', :sources => ["db_time", total_time] do |db_time, all_time|
16
+ all_time == 0 ? 0 : (db_time / all_time) * 100.0
17
+ end
18
+
19
+ end
metadata ADDED
@@ -0,0 +1,69 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: fiveruns-dash-activerecord
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.8.0
5
+ platform: ruby
6
+ authors:
7
+ - FiveRuns Development Team
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-02-18 00:00:00 -08:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: fiveruns-dash-ruby
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 0.8.0
24
+ version:
25
+ description: Provides an API to send metrics from applications using ActiveRecord to the FiveRuns Dash service
26
+ email: dev@fiveruns.com
27
+ executables: []
28
+
29
+ extensions: []
30
+
31
+ extra_rdoc_files: []
32
+
33
+ files:
34
+ - README.rdoc
35
+ - VERSION.yml
36
+ - lib/fiveruns
37
+ - lib/fiveruns/dash
38
+ - lib/fiveruns/dash/recipes
39
+ - lib/fiveruns/dash/recipes/activerecord.rb
40
+ - lib/fiveruns-dash-activerecord.rb
41
+ has_rdoc: true
42
+ homepage: http://github.com/fiveruns/dash-activerecord
43
+ post_install_message:
44
+ rdoc_options:
45
+ - --inline-source
46
+ - --charset=UTF-8
47
+ require_paths:
48
+ - lib
49
+ required_ruby_version: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: "0"
54
+ version:
55
+ required_rubygems_version: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ version: "0"
60
+ version:
61
+ requirements: []
62
+
63
+ rubyforge_project:
64
+ rubygems_version: 1.2.0
65
+ signing_key:
66
+ specification_version: 2
67
+ summary: FiveRuns Dash recipe for ActiveRecord
68
+ test_files: []
69
+