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 +7 -0
- data/glimpse-mongo.gemspec +2 -1
- data/lib/glimpse/views/mongo.rb +10 -5
- data/lib/glimpse-mongo/version.rb +1 -1
- metadata +20 -3
data/CHANGELOG.md
ADDED
data/glimpse-mongo.gemspec
CHANGED
data/lib/glimpse/views/mongo.rb
CHANGED
@@ -4,7 +4,7 @@ require 'mongo'
|
|
4
4
|
# and the following methods:
|
5
5
|
#
|
6
6
|
# - :send_message
|
7
|
-
# - :
|
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
|
27
|
+
def send_message_with_gle_with_timing(*args)
|
28
28
|
start = Time.now
|
29
|
-
|
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 :
|
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
|
-
|
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
|
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.
|
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-
|
12
|
+
date: 2013-03-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
name:
|
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
|