Skip to content

Commit 0f0a118

Browse files
authored
MONGOID-4811 Output controller runtime stats in milliseconds (#5309)
1 parent aab34ab commit 0f0a118

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/mongoid/railties/controller_runtime.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class Collector
6262
def started _; end
6363

6464
def _completed e
65-
Collector.runtime += e.duration
65+
Collector.runtime += e.duration * 1000
6666
end
6767
alias :succeeded :_completed
6868
alias :failed :_completed

spec/rails/controller_extension/controller_runtime_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ def clear_metric!
3030

3131
clear_metric!
3232
instance.succeeded event_payload
33-
expect(collector.runtime).to eq(42)
33+
expect(collector.runtime).to eq(42000)
3434

3535
clear_metric!
3636
instance.failed event_payload
37-
expect(collector.runtime).to eq(42)
37+
expect(collector.runtime).to eq(42000)
3838
end
3939

4040
it "resets the metric and returns the value" do

0 commit comments

Comments
 (0)