Skip to content

Commit

Permalink
Ref wvanbergen#155 - Millisecond label to whole numbers
Browse files Browse the repository at this point in the history
- Per @barttenbrinke comment
  • Loading branch information
jefflunt committed Mar 31, 2014
1 parent 5993793 commit 1510586
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/request_log_analyzer/tracker/duration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def prepare
def display_value(time)
case time
when nil then '-'
when 0...1 then "%0.02fms" % (time*1000)
when 0...1 then "%0ims" % (time*1000)
when 1...60 then "%0.02fs" % time
when 60...3600 then "%dm%02ds" % [time / 60, (time % 60).round]
else "%dh%02dm%02ds" % [time / 3600, (time % 3600) / 60, (time % 60).round]
Expand Down
4 changes: 2 additions & 2 deletions spec/integration/mailer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
find_string_in_file("From: Request-log-analyzer reporter <[email protected]>", @log_file).should_not be_nil
find_string_in_file("Subject: Request log analyzer report - generated on", @log_file).should_not be_nil
find_string_in_file("Request summary", @log_file).should_not be_nil
find_string_in_file("People | 1 | 40.30ms | 40.30ms | 0.00ms | 40.30ms | 40.30ms | 40.18ms-41.50ms", @log_file).should_not be_nil
find_string_in_file("PeopleControll | 1 | 40ms | 40ms | 0ms | 40ms | 40ms | 40ms-41ms", @log_file).should_not be_nil
end

it "should allow a custom mail subject" do
Expand Down Expand Up @@ -68,7 +68,7 @@
find_string_in_file("To: <root@localhost>", @log_file).should_not be_nil
find_string_in_file("From: Request-log-analyzer reporter <[email protected]>", @log_file).should_not be_nil
find_string_in_file('<h1>Request-log-analyzer summary report</h1>', @log_file).should_not be_nil
find_string_in_file('<td class="alt">287.08ms-296.48ms</td></tr><tr><td>DashboardController#index.html [GET]</td>', @log_file).should_not be_nil
find_string_in_file('<td class="alt">287ms-296ms</td></tr><tr><td>DashboardController#index.html [GET]</td>', @log_file).should_not be_nil
end
end

Expand Down

0 comments on commit 1510586

Please sign in to comment.