glimpse-mongo 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ # 1.0.0
2
+
3
+ - Initial release.
4
+
5
+ # 1.0.1
6
+
7
+ - Require mongo >= 1.8 for method consistency.
@@ -17,5 +17,6 @@ Gem::Specification.new do |gem|
17
17
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
18
  gem.require_paths = ['lib']
19
19
 
20
- gem.add_dependency 'mongo'
20
+ gem.add_dependency 'glimpse'
21
+ gem.add_dependency 'mongo', '>= 1.8'
21
22
  end
@@ -4,7 +4,7 @@ require 'mongo'
4
4
  # and the following methods:
5
5
  #
6
6
  # - :send_message
7
- # - :send_message_with_safe_check
7
+ # - :send_message_with_gle
8
8
  # - :receive_message
9
9
 
10
10
  # Instrument Mongo time
@@ -24,14 +24,14 @@ class Mongo::Connection
24
24
  end
25
25
  alias_method_chain :send_message, :timing
26
26
 
27
- def send_message_with_safe_check_with_timing(*args)
27
+ def send_message_with_gle_with_timing(*args)
28
28
  start = Time.now
29
- send_message_with_safe_check_without_timing(*args)
29
+ send_message_with_gle_without_timing(*args)
30
30
  ensure
31
31
  Mongo::Connection.command_time += (Time.now - start)
32
32
  Mongo::Connection.command_count += 1
33
33
  end
34
- alias_method_chain :send_message_with_safe_check, :timing
34
+ alias_method_chain :send_message_with_gle, :timing
35
35
 
36
36
  def receive_message_with_timing(*args)
37
37
  start = Time.now
@@ -51,7 +51,12 @@ module Glimpse
51
51
  end
52
52
 
53
53
  def formatted_duration
54
- "%.2fms" % (duration * 1000)
54
+ ms = duration * 1000
55
+ if ms >= 1000
56
+ "%.2fms" % ms
57
+ else
58
+ "%.0fms" % ms
59
+ end
55
60
  end
56
61
 
57
62
  def calls
@@ -1,5 +1,5 @@
1
1
  module Glimpse
2
2
  module Mongo
3
- VERSION = '1.0.0'
3
+ VERSION = '1.0.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glimpse-mongo
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,10 +9,10 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-09 00:00:00.000000000 Z
12
+ date: 2013-03-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
- name: mongo
15
+ name: glimpse
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
@@ -27,6 +27,22 @@ dependencies:
27
27
  - - ! '>='
28
28
  - !ruby/object:Gem::Version
29
29
  version: '0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: mongo
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '1.8'
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '1.8'
30
46
  description: Provide a glimpse into the Mongo commands made within your Rails application.
31
47
  email:
32
48
  - me@garrettbjerkhoel.com
@@ -35,6 +51,7 @@ extensions: []
35
51
  extra_rdoc_files: []
36
52
  files:
37
53
  - .gitignore
54
+ - CHANGELOG.md
38
55
  - Gemfile
39
56
  - LICENSE.txt
40
57
  - README.md