Skip to content

Commit

Permalink
Revert "High-resolution timings."
Browse files Browse the repository at this point in the history
This reverts commit d17c771.
  • Loading branch information
flatheadmill committed Nov 4, 2018
1 parent 74a6714 commit 80ba394
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 27 deletions.
11 changes: 0 additions & 11 deletions duration.js

This file was deleted.

16 changes: 7 additions & 9 deletions reactor.js
Expand Up @@ -32,8 +32,6 @@ var typer = require('content-type')

var arrayed = require('./arrayed')

var duration = require('./duration')

function Constructor (object, dispatch) {
this._object = object
this._dispatch = dispatch
Expand Down Expand Up @@ -75,7 +73,7 @@ function handler (queue, before, operation) {
var vargs = Array.prototype.slice.call(arguments, 3)
request.entry = {
when: {
push: process.hrtime(),
push: Date.now(),
start: null,
headers: null,
finish: null
Expand Down Expand Up @@ -151,7 +149,7 @@ Reactor.prototype._respond = cadence(function (async, envelope) {

var entry = work.request.entry

entry.when.start = process.hrtime()
entry.when.start = Date.now()
entry.health.start = JSON.parse(JSON.stringify(this.turnstile.health))

work.request.entry = entry
Expand Down Expand Up @@ -252,7 +250,7 @@ Reactor.prototype._respond = cadence(function (async, envelope) {

work.response.writeHead(responder.statusCode, responder.description, responder.headers)

entry.when.headers = process.hrtime()
entry.when.headers = Date.now()

entry.statusCode = responder.statusCode
entry.description = responder.description
Expand All @@ -278,11 +276,11 @@ Reactor.prototype._respond = cadence(function (async, envelope) {
})
}, function () {
entry.health.done = JSON.parse(JSON.stringify(this.turnstile.health))
entry.when.finish = process.hrtime()
entry.when.finish = Date.now()
entry.duration = {
start: duration(entry.when.push, entry.when.start),
headers: duration(entry.when.push, entry.when.headers),
finish: duration(entry.when.push, entry.when.finish)
start: entry.when.start - entry.when.push,
headers: entry.when.headers - entry.when.push,
finish: entry.when.finish - entry.when.push
}
this._logger.call(null, entry)
this._completed.call(null, entry)
Expand Down
7 changes: 0 additions & 7 deletions t/duration.t.js

This file was deleted.

0 comments on commit 80ba394

Please sign in to comment.