grape-librato 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,9 @@
1
+ rvm:
2
+ - 2.0.0
3
+ - 1.8.7
4
+ - 1.9.2
5
+ - 1.9.3
6
+ - jruby
7
+ - rbx
8
+ - ree
9
+
@@ -1,5 +1,12 @@
1
1
  ## Changelog
2
2
 
3
+ ### Version 1.1.0
4
+ * Add 'increment' metric as well as timing
5
+ * Add 'grape' prefix to metrics
6
+
7
+ ### Version 1.0.0
8
+ * Okay, we're live
9
+
3
10
  ### Version 0.0.1
4
11
  * Maybe it's working
5
12
 
data/README.md CHANGED
@@ -3,6 +3,8 @@
3
3
  Librato tracking for [Grape][0], based on code from [this NewRelic
4
4
  gem][1], using [librato-rack][2]
5
5
 
6
+ [![Build Status](https://travis-ci.org/seanmoon/grape-librato.png?branch=master)](http://travis-ci.org/seanmoon/grape-librato)
7
+
6
8
  ## Installation
7
9
 
8
10
  Add this line to your application's Gemfile:
@@ -11,7 +11,9 @@ module Librato
11
11
  def call(env)
12
12
  req = ::Rack::Request.new(env)
13
13
  request_path = env['api.endpoint'].routes.first.route_path[1..-1].gsub("/", ".").sub(/\(\.:format\)\z/, "")
14
- Librato.timing "#{req.request_method}.#{request_path}" do
14
+ metric_name = "grape.#{req.request_method}.#{request_path}"
15
+ Librato.increment metric_name
16
+ Librato.timing "#{metric_name}.time" do
15
17
  @app.call(env)
16
18
  end
17
19
  end
@@ -1,5 +1,5 @@
1
1
  module Librato
2
2
  module Grape
3
- VERSION = "1.0.0"
3
+ VERSION = "1.1.0"
4
4
  end
5
5
  end
@@ -11,8 +11,9 @@ describe Librato::Grape::Middleware do
11
11
 
12
12
  def app; TestAPI; end
13
13
 
14
- it "should send a timing event for each request" do
15
- Librato.should_receive(:timing).with('GET.hello.:name').and_yield
14
+ it "should send an increment and timing event for each request" do
15
+ Librato.should_receive(:increment).with('grape.GET.hello.:name')
16
+ Librato.should_receive(:timing).with('grape.GET.hello.:name.time').and_yield
16
17
  get "/hello/sean"
17
18
  last_response.status.should == 200
18
19
  last_response.body.should == "hello sean"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grape-librato
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-18 00:00:00.000000000Z
12
+ date: 2013-04-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: grape
16
- requirement: &2155117680 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,15 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2155117680
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
25
30
  - !ruby/object:Gem::Dependency
26
31
  name: librato-rack
27
- requirement: &2155117060 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
28
33
  none: false
29
34
  requirements:
30
35
  - - ! '>='
@@ -32,7 +37,12 @@ dependencies:
32
37
  version: '0'
33
38
  type: :runtime
34
39
  prerelease: false
35
- version_requirements: *2155117060
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
36
46
  description: librato metrics for grape
37
47
  email:
38
48
  - ssamoon@ucla.edu
@@ -42,6 +52,7 @@ extra_rdoc_files: []
42
52
  files:
43
53
  - .gitignore
44
54
  - .rspec
55
+ - .travis.yml
45
56
  - CHANGELOG.md
46
57
  - Gemfile
47
58
  - LICENSE
@@ -74,7 +85,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
74
85
  version: '0'
75
86
  requirements: []
76
87
  rubyforge_project:
77
- rubygems_version: 1.8.11
88
+ rubygems_version: 1.8.25
78
89
  signing_key:
79
90
  specification_version: 3
80
91
  summary: librato metrics for grape
@@ -82,3 +93,4 @@ test_files:
82
93
  - spec/grape-librato/middleware_spec.rb
83
94
  - spec/grape-librato/version_spec.rb
84
95
  - spec/spec_helper.rb
96
+ has_rdoc: