metricize 0.5.4 → 0.5.6

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: 01a5e5a2c6e58a774f31b33dfd8395150cf3165a
4
- data.tar.gz: dc8586370108272fd6ccad88af185d4ff6c311e1
3
+ metadata.gz: 33dee0202b4640b85a538c6a237e77b78ca34d8d
4
+ data.tar.gz: 6fe18075dec61f94f16bc91705b44994f5020f81
5
5
  SHA512:
6
- metadata.gz: 34e646619bd6bf41da902fb793498d81a9d9e82f834c662e0de3edef749a9ef92e8ef9208092e3375f1113b352c8412e74958e7b9231c79023d1acd09e99fe15
7
- data.tar.gz: 6c8e9227d21962f8389a7d73fcccc770e975c5e794b89cc37516017daf60ebf0867bad5fa27176bdbf49595b726bae5301b7cd9a5121eecfabf766cd3a85f826
6
+ metadata.gz: 36932c5cd3332f3a6f23d3ba77d642e8e82ebdc308315b92ef2812e52600f581fe96d5b748bf82a8e44ee189e76bef66bb875aea929f794bab590b6d55b474ec
7
+ data.tar.gz: 055c1b493f97cc78cfe4e1e70ea461fc7af192b5221f471f965b28455114d3b1139f4faa7b1a62c6f2254e21ae8635143f44d52e1a1bace7c374b86f08a58f57
@@ -22,7 +22,7 @@ module Metricize
22
22
  raise ArgumentError, "must be invoked with a block to time" unless block_given?
23
23
  start_time = Time.now
24
24
  block_result = yield
25
- measure(name + '.time', time_delta_ms(start_time))
25
+ measure(name + '.time', time_delta_ms(start_time), options)
26
26
  return block_result
27
27
  end
28
28
 
@@ -1,3 +1,3 @@
1
1
  module Metricize
2
- VERSION = "0.5.4"
2
+ VERSION = "0.5.6"
3
3
  end
@@ -33,7 +33,7 @@ describe Metricize do
33
33
  expect(first_gauge['name']).to eq "prefix.stat.name.count"
34
34
  expect(first_gauge['source']).to eq "my_source"
35
35
  expect(first_gauge['attributes']).to eq("source_aggregate" => true, "summarize_function" => "sum")
36
- expect(request_params).to eq( :timeout => 10, :content_type => "application/json" )
36
+ expect(request_params).to eq( :timeout => 12, :content_type => "application/json" )
37
37
  end
38
38
  forwarder.go!
39
39
  end
@@ -221,11 +221,12 @@ describe Metricize do
221
221
  end
222
222
 
223
223
  it "times and reports the execution of a block of code in milliseconds" do
224
- client.time('my_slow_code') do
224
+ client.time('my_slow_code', source: 'my_source') do
225
225
  Timecop.travel(5) # simulate 5000 milliseconds of runtime
226
226
  end
227
227
  RestClient.should_receive(:post).with do | _, post_data |
228
228
  first_gauge = JSON.parse(post_data)['gauges'].first
229
+ expect(first_gauge['source']).to eq('my_source')
229
230
  expect(first_gauge['name']).to eq('prefix.my_slow_code.time')
230
231
  expect(first_gauge['value']).to be_within(0.2).of(5000)
231
232
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metricize
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.4
4
+ version: 0.5.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt McNeil
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-07 00:00:00.000000000 Z
11
+ date: 2013-10-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler