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 +4 -4
- data/lib/metricize/client.rb +1 -1
- data/lib/metricize/version.rb +1 -1
- data/spec/lib/metricize_spec.rb +3 -2
- metadata +2 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 33dee0202b4640b85a538c6a237e77b78ca34d8d
         | 
| 4 | 
            +
              data.tar.gz: 6fe18075dec61f94f16bc91705b44994f5020f81
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 36932c5cd3332f3a6f23d3ba77d642e8e82ebdc308315b92ef2812e52600f581fe96d5b748bf82a8e44ee189e76bef66bb875aea929f794bab590b6d55b474ec
         | 
| 7 | 
            +
              data.tar.gz: 055c1b493f97cc78cfe4e1e70ea461fc7af192b5221f471f965b28455114d3b1139f4faa7b1a62c6f2254e21ae8635143f44d52e1a1bace7c374b86f08a58f57
         | 
    
        data/lib/metricize/client.rb
    CHANGED
    
    | @@ -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 |  | 
    
        data/lib/metricize/version.rb
    CHANGED
    
    
    
        data/spec/lib/metricize_spec.rb
    CHANGED
    
    | @@ -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 =>  | 
| 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 | 
            +
              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- | 
| 11 | 
            +
            date: 2013-10-08 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: bundler
         |