chillout 0.8.4 → 0.8.5

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: 8308f094f935ed83592a06a45fe6b15dfc32fb7a
4
- data.tar.gz: 2a23cac7e8d85f95ebf6f6fb5ba82cd531d3cc45
3
+ metadata.gz: 1c33745fc085c99ca82736cd443c79f39125c6b9
4
+ data.tar.gz: b7bd217d44922e5a4184fe9831c16342ba55605d
5
5
  SHA512:
6
- metadata.gz: b1d901f3d22ec457782f8376c30851b338779a2c3f63be2753213ecb111b215f4ed034084f78956db9411a80d6cb123bad0a0ada315da8dc66cf168085755fc9
7
- data.tar.gz: 2848b76d928fa80ed56d8633b791744c5c5fe24d43c727570e5543b83c644aef0d3783daebc3ea612b5d1294108fd7159267fc8577f7133919994cc12e35b473
6
+ metadata.gz: 8638e7bae9c0d173a34d464d2d4f5ae6acb6cc240f50eb64d19447d0892acb5bb02425870f9859e8b4f23396152baa81cd2da467ebea9651d745ecd8b3c4776d
7
+ data.tar.gz: 275ffc019ef780c186dc856b04f065ee1b425b036238061626096eabf0b706ccb06f6510e29615a566a49f92caa0b3387b350f54caa958a167ad1874417742ff
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # chillout gem changes
2
2
 
3
+ 0.8.5
4
+ -----
5
+
6
+ - Bugfix: Duration metrics are always sent as floats.
7
+
3
8
  0.8.4
4
9
  -----
5
10
 
@@ -25,9 +25,9 @@ module Chillout
25
25
  timestamp: self.end.iso8601,
26
26
  values: {
27
27
  finished: 1,
28
- duration: duration,
29
- db: payload[:db_runtime] || 0,
30
- view: payload[:view_runtime] || 0,
28
+ duration: duration.to_f,
29
+ db: (payload[:db_runtime] || 0).to_f,
30
+ view: (payload[:view_runtime] || 0).to_f,
31
31
  },
32
32
  }]
33
33
  end
@@ -1,3 +1,3 @@
1
1
  module Chillout
2
- VERSION = "0.8.4"
2
+ VERSION = "0.8.5"
3
3
  end
@@ -1,6 +1,14 @@
1
1
  require 'test_helper'
2
2
 
3
3
  class ChilloutModuleTest < ChilloutTestCase
4
+ def setup
5
+ Chillout.creations = nil
6
+ end
7
+
8
+ def teardown
9
+ Chillout.creations = nil
10
+ end
11
+
4
12
  def test_custom_metrics
5
13
  Chillout::Metric.track('RegistrationCompleted')
6
14
  assert_equal 1, Chillout.creations['RegistrationCompleted']
@@ -43,6 +43,29 @@ module Chillout
43
43
  },
44
44
  }], metric.as_measurements
45
45
  end
46
+
47
+ def test_measurements_are_floats
48
+ time = Time.utc(2017, 6, 27, 10, 26, 33)
49
+ metric = ActionControllerNotifications::RequestMetric.new(
50
+ ActiveSupport::Notifications::Event.new(
51
+ "asd", time, time, "uniq", {
52
+ controller: "PostsController",
53
+ action: "index",
54
+ params: {"action" => "index", "controller" => "posts"},
55
+ headers: nil, #ActionDispatch::Http::Headers.new,
56
+ format: :html,
57
+ method: "GET",
58
+ path: "/posts",
59
+ status: 200,
60
+ view_runtime: 46,
61
+ db_runtime: 1,
62
+ }
63
+ ))
64
+ values = metric.as_measurements[0].fetch(:values)
65
+ assert 0.0.eql? values.fetch(:duration)
66
+ assert 1.0.eql? values.fetch(:db)
67
+ assert 46.0.eql? values.fetch(:view)
68
+ end
46
69
  end
47
70
  end
48
71
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chillout
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.4
4
+ version: 0.8.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michal Lomnicki
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2017-06-29 00:00:00.000000000 Z
14
+ date: 2017-07-03 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: multi_json