を使用して http サーバーを作成しhttp.createServer(onRequest)
、応答に必要な時間を測定したいと考えています。
現在、私のonRequest
ハンドラーでは次のことを行っています。
var start = process.hrtime();
response.on('end', function (){
console.log('time to respond', process.hrtime(start));
});
// call various asynchronous functions and send them 'response' object. One of them eventually does response.end()
大量のリクエストが即座に送信されたときにこれがうまく機能するかどうか、または非同期性がそれを壊したり混同したりするのではないかと心配していますか?