fiveruns-dash-sinatra 0.7.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,81 @@
1
+ = FiveRuns Dash recipe for Sinatra
2
+
3
+ Provides a Ruby API to push metrics from a Sinatra app 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-sinatra
10
+
11
+ sudo gem install fiveruns-dash-sinatra --source 'http://gems.github.com'
12
+
13
+ == Usage
14
+
15
+ First you'll need a token for your Sinatra application. Create a new Ruby app in Dash (http://dash.fiveruns.com) and copy the token.
16
+
17
+ Make sure you require the Dash Sinatra recipe:
18
+
19
+ require 'fiveruns/dash/sinatra'
20
+
21
+ Now, in your configure block, start up Dash:
22
+
23
+ Fiveruns::Dash::Sinatra.start('the-dash-token-you-copied')
24
+
25
+ Fire up your Sinatra app; you should see it send some environmental information to Dash. Periodically, a background thread will upload your metrics to Dash.
26
+
27
+ == Caveats
28
+
29
+ Sinatra adds a route for serving static files from your +public+ folder. If you run Dash in development, these requests will color your requests and response time statistics. If you are using Nginx or Apache to public in your production app, your metrics will be fine.
30
+
31
+ == Authors
32
+
33
+ The FiveRuns Development Team & Dash community
34
+
35
+ == Dependencies
36
+
37
+ * The fiveruns-dash-ruby gem (see http://github.com/fiveruns/dash-ruby)
38
+ * The json gem (as a dependency for fiveruns-dash-ruby)
39
+
40
+ == Sinatra versions
41
+
42
+ Dash has been tested with Sinatra 0.9.0. It may work with later versions, but almost certainly doesn't work with earlier versions (0.3.x).
43
+
44
+ == Contributing
45
+
46
+ As an open source project, we welcome community contributions!
47
+
48
+ The best way to contribute is by sending pull requests via GitHub. The official repository for this project is:
49
+
50
+ http://github.com/fiveruns/dash-sinatra
51
+
52
+ == Support
53
+
54
+ Please join the dash-users Google group, http://groups.google.com/group/dash-users
55
+
56
+ You can also contact us via Twitter, Campfire, or email; see the main help page, http://dash.fiveruns.com/help, for details.
57
+
58
+ == License
59
+
60
+ # (The FiveRuns License)
61
+ #
62
+ # Copyright (c) 2006-2009 FiveRuns Corporation
63
+ #
64
+ # Permission is hereby granted, free of charge, to any person obtaining
65
+ # a copy of this software and associated documentation files (the
66
+ # 'Software'), to deal in the Software without restriction, including
67
+ # without limitation the rights to use, copy, modify, merge, publish,
68
+ # distribute, sublicense, and/or sell copies of the Software, and to
69
+ # permit persons to whom the Software is furnished to do so, subject to
70
+ # the following conditions:
71
+ #
72
+ # The above copyright notice and this permission notice shall be
73
+ # included in all copies or substantial portions of the Software.
74
+ #
75
+ # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
76
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
77
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
78
+ # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
79
+ # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
80
+ # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
81
+ # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,17 @@
1
+ begin
2
+ require 'jeweler'
3
+
4
+ Jeweler::Tasks.new do |s|
5
+ s.name = 'dash-sinatra'
6
+ s.rubyforge_project = 'fiveruns'
7
+ s.summary = 'Fiveruns Dash recipe for Sinatra'
8
+ s.email = 'dev@fiveruns.com'
9
+ s.homepage = 'http://github.com/fiveruns/dash-sinatra'
10
+ s.description = 'Provides an API to send metrics from Sinatra applications to the FiveRuns Dash service'
11
+ s.authors = ['FiveRuns Development Team']
12
+ s.files = FileList['README.rdoc', 'Rakefile', 'version.yml', '{lib}/**/*']
13
+ s.add_dependency 'fiveruns-dash-ruby', '>= 0.7.1'
14
+ end
15
+ rescue LoadError
16
+ puts "Jeweler, or one of its dependencies, is not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
17
+ end
@@ -0,0 +1,23 @@
1
+ require 'fiveruns/dash'
2
+
3
+ Fiveruns::Dash.logger.level = Logger::INFO
4
+
5
+ Fiveruns::Dash.register_recipe :sinatra, :url => 'http://dash.fiveruns.com' do |recipe|
6
+ # NOTE: Captures static requests in addition to Sinatra app requests. Can't
7
+ # find a good way around that.
8
+ recipe.counter :requests, :incremented_by => 'Sinatra::Application#dispatch!'
9
+ recipe.time :response_time, :method => 'Sinatra::Application#dispatch!'
10
+ recipe.time :render_time, :method => 'Sinatra::Application#render'
11
+ end
12
+
13
+ module Fiveruns::Dash::Sinatra
14
+
15
+ def self.start(token)
16
+ return if Fiveruns::Dash.session.reporter.started?
17
+ Fiveruns::Dash.start(:app => token) do |config|
18
+ config.add_recipe :sinatra
19
+ config.add_recipe :ruby
20
+ end
21
+ end
22
+
23
+ end
@@ -0,0 +1,4 @@
1
+ ---
2
+ :major: 0
3
+ :minor: 7
4
+ :patch: 5
metadata ADDED
@@ -0,0 +1,67 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: fiveruns-dash-sinatra
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.7.5
5
+ platform: ruby
6
+ authors:
7
+ - FiveRuns Development Team
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-01-30 00:00:00 -08:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: fiveruns-dash-ruby
17
+ version_requirement:
18
+ version_requirements: !ruby/object:Gem::Requirement
19
+ requirements:
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 0.7.1
23
+ version:
24
+ description: Provides an API to send metrics from Sinatra applications to the FiveRuns Dash service
25
+ email: dev@fiveruns.com
26
+ executables: []
27
+
28
+ extensions: []
29
+
30
+ extra_rdoc_files: []
31
+
32
+ files:
33
+ - README.rdoc
34
+ - Rakefile
35
+ - version.yml
36
+ - lib/fiveruns
37
+ - lib/fiveruns/dash
38
+ - lib/fiveruns/dash/sinatra.rb
39
+ has_rdoc: true
40
+ homepage: http://github.com/fiveruns/dash-sinatra
41
+ post_install_message:
42
+ rdoc_options:
43
+ - --inline-source
44
+ - --charset=UTF-8
45
+ require_paths:
46
+ - lib
47
+ required_ruby_version: !ruby/object:Gem::Requirement
48
+ requirements:
49
+ - - ">="
50
+ - !ruby/object:Gem::Version
51
+ version: "0"
52
+ version:
53
+ required_rubygems_version: !ruby/object:Gem::Requirement
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ version: "0"
58
+ version:
59
+ requirements: []
60
+
61
+ rubyforge_project: fiveruns
62
+ rubygems_version: 1.2.0
63
+ signing_key:
64
+ specification_version: 2
65
+ summary: Fiveruns Dash recipe for Sinatra
66
+ test_files: []
67
+