Skip to content

Commit

Permalink
Revert "failed requests are also counted in response time stats"
Browse files Browse the repository at this point in the history
This reverts commit 0fe7ab9.
  • Loading branch information
Eevert Saukkokoski committed Mar 27, 2015
1 parent 0fe7ab9 commit 3d45ac1
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions tasks/benchmark.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ http = require('../src/http')(Promise)
stats = require 'simple-statistics'

###
(f: () -> Promise) -> Promise milliseconds
(f: () -> Promise) -> milliseconds
###
time = (f) ->
timestamp = +new Date
diff = -> (+new Date)-timestamp
Promise.resolve(f()).then(diff, diff)
Promise.resolve(f()).then ->
(+new Date)-timestamp

markCompletion = (p) ->
p.then(
Expand All @@ -25,8 +25,7 @@ markCompletion = (p) ->
benchmarkResultStream = (f, concurrency, total) ->
Bacon.fromArray(i for i in [0..total-1])
.flatMapWithConcurrencyLimit(concurrency, (i) ->
Bacon.fromPromise time ->
markCompletion f()
Bacon.fromPromise markCompletion time(f)
)

module.exports = (grunt) ->
Expand Down

0 comments on commit 3d45ac1

Please sign in to comment.