Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge pull request #4 from dblock/readme

README updates w/ Testing and Demos
  • Loading branch information...
commit 3a560ccc27b6e13cd767372be1a9897a04cdc9c0 2 parents 0308700 + 1ae0eba
Richard Huang authored January 06, 2013

Showing 1 changed file with 30 additions and 3 deletions. Show diff stats Hide diff stats

  1. 33  README.md
33  README.md
Source Rendered
... ...
@@ -1,6 +1,6 @@
1 1
 # NewRelic::Grape
2 2
 
3  
-NewRelic instrument for [grape][0], this is inspired from this [blog post][1].
  3
+NewRelic instrumentation for the [Grape API DSL][0], inspired by [this blog post][1].
4 4
 
5 5
 ## Installation
6 6
 
@@ -18,12 +18,37 @@ Or install it yourself as:
18 18
 
19 19
 ## Usage
20 20
 
21  
-That's it.
  21
+Ensure that you have working NewRelic instrumentation. Add the `newrelic-grape` gem. That's it.
22 22
 
23 23
 ## Disabling Instrumentation
24 24
 
25 25
 Set `disable_grape` in `newrelic.yml` or `ENV['DISABLE_NEW_RELIC_GRAPE']` to disable instrumentation.
26 26
 
  27
+## Testing
  28
+
  29
+This gem naturally works in NewRelic developer mode. For more information see the [NewRelic Developer Documentation][2].
  30
+
  31
+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.
  32
+
  33
+### RSpec
  34
+
  35
+``` ruby
  36
+describe NewRelic::Agent::Instrumentation::Grape do
  37
+  it "traces" do
  38
+    NewRelic::Agent::Instrumentation::Grape
  39
+      .any_instance
  40
+      .should_receive(:perform_action_with_newrelic_trace)
  41
+      .and_yield
  42
+    get "/ping"
  43
+    response.status.should == 200
  44
+  end
  45
+end
  46
+```
  47
+
  48
+## Demos
  49
+
  50
+* [Grape on Rack w/ NewRelic Instrumentation Enabled][3]
  51
+
27 52
 ## Contributing
28 53
 
29 54
 1. Fork it
@@ -34,4 +59,6 @@ Set `disable_grape` in `newrelic.yml` or `ENV['DISABLE_NEW_RELIC_GRAPE']` to dis
34 59
 6. Create new Pull Request
35 60
 
36 61
 [0]: https://github.com/intridea/grape
37  
-[1]: http://artsy.github.com/blog/2012/11/29/measuring-performance-in-grape-apis-with-new-relic/
  62
+[1]: http://artsy.github.com/blog/2012/11/29/measuring-performance-in-grape-apis-with-new-relic
  63
+[2]: https://newrelic.com/docs/ruby/developer-mode
  64
+[3]: https://github.com/dblock/grape-on-rack

0 notes on commit 3a560cc

Please sign in to comment.
Something went wrong with that request. Please try again.