coach 0.5.0 → 0.5.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2f7d2343c7e554691c7dc038d2673e23c46656fb
4
- data.tar.gz: 2cd586a0f983cd8e357f230fc9cacfdf11dbf4ec
3
+ metadata.gz: 5f0c3cad8cac567d6a7896cb42598f1c9215cb92
4
+ data.tar.gz: a235b7b236bede96cb741f6a660fcb5a1a52790b
5
5
  SHA512:
6
- metadata.gz: 6879f15e2f13a29c063274ebc59ddac2006e7343848d2e188f83821f6a796d0e61549cabbcc125c5d66790221b7fa9e618ad97064b4c61f982366f6cc6592f61
7
- data.tar.gz: 88c3755e9df7000de77a7c0a5f0dc4e92c0ff4ba4257b4dba56580a7fc61b9f8067e66751c511317e94b5e386b4fcf8b1428b9988d494fd04f083a1856f14ca3
6
+ metadata.gz: 5211eac40826156ceb6687ecaa985d06b2173f09d1d6615b3439ac892ab2d9e823c21ee205cf4b4f74d52e289268b94def61ea4f37a35292cddf1f84ec21bd01
7
+ data.tar.gz: 514d4e0cde81513cc7d8386c926fca8ad7115bf8bc61e58e1cd5153d7cfa1a87069feddfa0eb9ca5f20066f270062da55c8739356d887e6cb576dea154dca029
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # CHANGELOG
2
2
 
3
+ # 0.5.1 / 2017-08-21
4
+
5
+ * [https://github.com/gocardless/coach/pull/26](#26) Add `started_at` to the
6
+ request event metadata.
7
+
3
8
  # 0.5.0 / 2017-08-07
4
9
 
5
10
  * [https://github.com/gocardless/coach/pull/24](#24) Use
data/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # Coach
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/coach.svg)](http://badge.fury.io/rb/coach)
4
- [![Build Status](https://travis-ci.org/gocardless/coach.png?branch=master)](https://travis-ci.org/gocardless/coach)
5
- [![Code Climate](https://codeclimate.com/github/gocardless/coach.png)](https://codeclimate.com/github/gocardless/coach)
4
+ [![Build Status](https://travis-ci.org/gocardless/coach.svg?branch=master)](https://travis-ci.org/gocardless/coach)
5
+ [![Code Climate](https://codeclimate.com/github/gocardless/coach.svg)](https://codeclimate.com/github/gocardless/coach)
6
6
 
7
7
  Coach improves your controller code by encouraging:
8
8
 
@@ -22,6 +22,7 @@ module Coach
22
22
  end
23
23
 
24
24
  def complete(start, finish)
25
+ @start = start
25
26
  @duration = finish - start
26
27
  end
27
28
 
@@ -29,6 +30,7 @@ module Coach
29
30
  def stats
30
31
  {
31
32
  endpoint_name: @endpoint_name,
33
+ started_at: @start,
32
34
  duration: format_ms(@duration),
33
35
  chain: sorted_chain.map do |event|
34
36
  { name: event[:name], duration: format_ms(event[:duration]) }
data/lib/coach/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Coach
2
- VERSION = '0.5.0'.freeze
2
+ VERSION = '0.5.1'.freeze
3
3
  end
@@ -26,6 +26,14 @@ describe Coach::RequestBenchmark do
26
26
  expect(stats[:duration]).to eq(5000)
27
27
  end
28
28
 
29
+ it "captures the endpoint_name" do
30
+ expect(stats[:endpoint_name]).to eq("ENDPOINT")
31
+ end
32
+
33
+ it "captures the started_at time" do
34
+ expect(stats[:started_at]).to eq(base_time)
35
+ end
36
+
29
37
  it "computes duration of middleware with no children" do
30
38
  expect(stats[:chain]).to include(name: 'B', duration: 1000)
31
39
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coach
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - GoCardless
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-07 00:00:00.000000000 Z
11
+ date: 2017-08-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack
@@ -150,7 +150,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
150
150
  version: '0'
151
151
  requirements: []
152
152
  rubyforge_project:
153
- rubygems_version: 2.6.8
153
+ rubygems_version: 2.6.11
154
154
  signing_key:
155
155
  specification_version: 4
156
156
  summary: Alternative controllers built with middleware