Skip to content

Commit

Permalink
Basic functions, docs; technical preview
Browse files Browse the repository at this point in the history
Requires fiveruns-dash-ruby >= 0.8.0 (remove-active-support branch, not merged to master w/ gem yet)
  • Loading branch information
Bruce Williams committed Feb 17, 2009
1 parent a95bbe8 commit 854e678
Show file tree
Hide file tree
Showing 14 changed files with 142 additions and 58 deletions.
7 changes: 0 additions & 7 deletions README

This file was deleted.

65 changes: 65 additions & 0 deletions README.rdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
= FiveRuns Dash library for Merb

Provides a Ruby API to push metrics to the FiveRuns Dash service, http://dash.fiveruns.com, currently in beta, from Merb, providing basic logging and a few metrics.

You'll need a Dash account before using this library.

== Installation

This library is released as a gem from the official repository at http://github.com/fiveruns/dash-merb

sudo gem install fiveruns-dash-merb --source http://gems.github.com

== Usage

See the Ruby support pages, http://support.fiveruns.com/faqs/dash/merb, for information on how to use this library.

== Authors

The FiveRuns Development Team & Dash community

== Dependencies

* fiveruns-dash-ruby (and dependencies)
* Merb 1.0+

== Contributing

As an open source project, we welcome community contributions!

The best way to contribute is by sending pull requests via GitHub. The official repository for this project is:

http://github.com/fiveruns/dash-merb

== Support

Please join the dash-users Google group, http://groups.google.com/group/dash-users

You can also contact us via Twitter, Campfire, or email; see the main help page, http://support.fiveruns.com, for details.

== License

# (The FiveRuns License)
#
# Copyright (c) 2006-2008 FiveRuns Corporation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# 'Software'), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


16 changes: 5 additions & 11 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ begin
Jeweler::Tasks.new do |s|
s.name = "dash-merb"
s.summary = %Q{FiveRuns Dash library for Merb}
s.email = "bruce@codefluency.com"
s.homepage = "http://github.com/bruce/dash-merb"
s.description = "TODO"
s.authors = ["Bruce Williams"]
s.email = "dev@fiveruns.com"
s.homepage = "http://github.com/fiveruns/dash-merb"
s.description = "Provides an API to send metrics from Merb 1.0+ applications to the FiveRuns Dash service"
s.authors = ["FiveRuns Development Team"]
s.add_dependency('fiveruns-dash-ruby', '>= 0.8.0')
end
rescue LoadError
puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
Expand Down Expand Up @@ -41,11 +42,4 @@ rescue LoadError
puts "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
end

begin
require 'cucumber/rake/task'
Cucumber::Rake::Task.new(:features)
rescue LoadError
puts "Cucumber is not available. In order to run features, you must: sudo gem install cucumber"
end

task :default => :test
2 changes: 1 addition & 1 deletion VERSION.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
:minor: 1
:minor: 6
:patch: 0
:major: 0
32 changes: 32 additions & 0 deletions dash-merb.gemspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# -*- encoding: utf-8 -*-

Gem::Specification.new do |s|
s.name = %q{dash-merb}
s.version = "0.6.0"

s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["FiveRuns Development Team"]
s.date = %q{2009-02-17}
s.description = %q{Provides an API to send metrics from Merb 1.0+ applications to the FiveRuns Dash service}
s.email = %q{dev@fiveruns.com}
s.files = ["README.rdoc", "VERSION.yml", "lib/dash-merb.rb", "lib/fiveruns", "lib/fiveruns/dash", "lib/fiveruns/dash/merb", "lib/fiveruns/dash/merb/recipe.rb", "lib/fiveruns/dash/merb.rb"]
s.has_rdoc = true
s.homepage = %q{http://github.com/fiveruns/dash-merb}
s.rdoc_options = ["--inline-source", "--charset=UTF-8"]
s.require_paths = ["lib"]
s.rubygems_version = %q{1.3.1}
s.summary = %q{FiveRuns Dash library for Merb}

if s.respond_to? :specification_version then
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
s.specification_version = 2

if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
s.add_runtime_dependency(%q<fiveruns-dash-ruby>, [">= 0.8.0"])
else
s.add_dependency(%q<fiveruns-dash-ruby>, [">= 0.8.0"])
end
else
s.add_dependency(%q<fiveruns-dash-ruby>, [">= 0.8.0"])
end
end
9 changes: 0 additions & 9 deletions features/dash_merb.feature

This file was deleted.

Empty file removed features/steps/dash_merb_steps.rb
Empty file.
13 changes: 0 additions & 13 deletions features/support/env.rb

This file was deleted.

16 changes: 16 additions & 0 deletions lib/dash-merb.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Depends on non-ActiveSupport fiveruns-dash-ruby (>= 0.8.0)
dependency 'fiveruns-dash-ruby', '>= 0.8.0', :require_as => 'fiveruns/dash',
:immediate => true
Merb::Config[:dash] = {
:token => nil,
:recipes => [
# This recipe can be removed, if desired
[:merb, 'http://dash.fiveruns.com']
]
}

Merb::BootLoader.after_app_loads do
Fiveruns::Dash.logger = Merb.logger
require 'fiveruns/dash/merb'
Fiveruns::Dash::Merb.start if Merb::Config[:dash][:token]
end
Empty file removed lib/dash_merb.rb
Empty file.
18 changes: 18 additions & 0 deletions lib/fiveruns/dash/merb.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
require 'fiveruns/dash/merb/recipe'

module Fiveruns::Dash
module Merb

def self.start
::Fiveruns::Dash.logger.info "Starting FiveRuns Dash"
Fiveruns::Dash.start(:app => ::Merb::Config[:dash][:token]) do |config|
Array(::Merb::Config[:dash][:recipes]).each do |set|
name, url = Array(set)
::Fiveruns::Dash.logger.debug "Adding FiveRuns Dash recipe: #{set.inspect}"
config.add_recipe(name, :url => url)
end
end
end

end
end
5 changes: 5 additions & 0 deletions lib/fiveruns/dash/merb/recipe.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Fiveruns::Dash.register_recipe :merb, :url => 'http://dash.fiveruns.com' do |recipe|
recipe.time 'response_time', :method => 'Merb::Request#dispatch_action'
recipe.counter 'requests', :incremented_by => 'Merb::Request#dispatch_action'
recipe.time 'render_time', :method => 'Merb::RenderMixin#render'
end
7 changes: 0 additions & 7 deletions test/dash_merb_test.rb

This file was deleted.

10 changes: 0 additions & 10 deletions test/test_helper.rb

This file was deleted.

0 comments on commit 854e678

Please sign in to comment.