Permalink
Browse files

Merge pull request #4 from dblock/readme

README updates w/ Testing and Demos
  • Loading branch information...
flyerhzm committed Jan 7, 2013
2 parents 0308700 + 1ae0eba commit 3a560ccc27b6e13cd767372be1a9897a04cdc9c0
Showing with 30 additions and 3 deletions.
  1. +30 −3 README.md
View
@@ -1,6 +1,6 @@
# NewRelic::Grape
-NewRelic instrument for [grape][0], this is inspired from this [blog post][1].
+NewRelic instrumentation for the [Grape API DSL][0], inspired by [this blog post][1].
## Installation
@@ -18,12 +18,37 @@ Or install it yourself as:
## Usage
-That's it.
+Ensure that you have working NewRelic instrumentation. Add the `newrelic-grape` gem. That's it.
## Disabling Instrumentation
Set `disable_grape` in `newrelic.yml` or `ENV['DISABLE_NEW_RELIC_GRAPE']` to disable instrumentation.
+## Testing
+
+This gem naturally works in NewRelic developer mode. For more information see the [NewRelic Developer Documentation][2].
+
+To ensure instrumentation in tests, check that `perform_action_with_newrelic_trace` is invoked on an instance of `NewRelic::Agent::Instrumentation::Grape` when calling your API.
+
+### RSpec
+
+``` ruby
+describe NewRelic::Agent::Instrumentation::Grape do
+ it "traces" do
+ NewRelic::Agent::Instrumentation::Grape
+ .any_instance
+ .should_receive(:perform_action_with_newrelic_trace)
+ .and_yield
+ get "/ping"
+ response.status.should == 200
+ end
+end
+```
+
+## Demos
+
+* [Grape on Rack w/ NewRelic Instrumentation Enabled][3]
+
## Contributing
1. Fork it
@@ -34,4 +59,6 @@ Set `disable_grape` in `newrelic.yml` or `ENV['DISABLE_NEW_RELIC_GRAPE']` to dis
6. Create new Pull Request
[0]: https://github.com/intridea/grape
-[1]: http://artsy.github.com/blog/2012/11/29/measuring-performance-in-grape-apis-with-new-relic/
+[1]: http://artsy.github.com/blog/2012/11/29/measuring-performance-in-grape-apis-with-new-relic
+[2]: https://newrelic.com/docs/ruby/developer-mode
+[3]: https://github.com/dblock/grape-on-rack

0 comments on commit 3a560cc

Please sign in to comment.