time_bandits 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -55,7 +55,8 @@ module ActionController #:nodoc:
55
55
  consumed_before_rendering = TimeBandits.consumed
56
56
  runtime = yield
57
57
  consumed_during_rendering = TimeBandits.consumed - consumed_before_rendering
58
- runtime - consumed_during_rendering
58
+ # TODO: time bandits all measure in seconds a.t.m.; this should be changed
59
+ runtime - consumed_during_rendering*1000
59
60
  end
60
61
 
61
62
  module ClassMethods
@@ -33,12 +33,13 @@ module TimeBandits
33
33
  end
34
34
 
35
35
  def runtime
36
- sprintf "ActiveRecord: %.3fms(%dq,%dh)", *info
36
+ time, calls, hits = *info
37
+ sprintf "ActiveRecord: %.3fms(%dq,%dh)", time*1000, calls, hits
37
38
  end
38
39
 
39
40
  def metrics
40
41
  {
41
- :db_time => info[0],
42
+ :db_time => info[0]*1000,
42
43
  :db_calls => info[1],
43
44
  :db_sql_query_cache_hits => info[2]
44
45
  }
@@ -51,7 +52,7 @@ module TimeBandits
51
52
  hits = s.reset_query_cache_hits
52
53
  calls = s.reset_call_count
53
54
  time = s.reset_runtime
54
- [time, calls, hits]
55
+ [time.to_f/1000, calls, hits]
55
56
  end
56
57
  end
57
58
  end
@@ -1,3 +1,3 @@
1
1
  module TimeBandits
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: time_bandits
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 19
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 3
10
- version: 0.1.3
9
+ - 4
10
+ version: 0.1.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Stefan Kaes
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-02-20 00:00:00 +01:00
18
+ date: 2012-02-27 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency