Skip to content

Commit

Permalink
Revert addition of responseSentTime
Browse files Browse the repository at this point in the history
  • Loading branch information
berzniz authored and arb committed Jan 29, 2018
1 parent 3f07b60 commit c8823c0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
4 changes: 2 additions & 2 deletions lib/index.js
Expand Up @@ -82,10 +82,10 @@ internals.utility = {
const method = internals.utility.formatMethod(event.method, settings);
const statusCode = internals.utility.formatStatusCode(event.statusCode, settings) || '';

// event, timestamp, id, instance, labels, method, path, query, responseTime, responseSentTime,
// event, timestamp, id, instance, labels, method, path, query, responseTime,
// statusCode, pid, httpVersion, source, remoteAddress, userAgent, referer, log
// method, pid, error
const output = `${event.instance}: ${method} ${event.path} ${query} ${statusCode} (responseSentTime: ${event.responseSentTime}ms) (responseTime: ${event.responseTime}ms)`;
const output = `${event.instance}: ${method} ${event.path} ${query} ${statusCode} (${event.responseTime}ms)`;

const response = {
id: event.id,
Expand Down
20 changes: 9 additions & 11 deletions test/index.js
Expand Up @@ -40,7 +40,6 @@ internals.ops = {
requests: {},
concurrents: {},
responseTimes: {},
responseSentTimes: {},
listener: {},
sockets: { http: {}, https: {} }
}
Expand All @@ -58,7 +57,6 @@ internals.response = {
name: 'adam'
},
responseTime: 150,
responseSentTime: 100,
statusCode: 200,
pid: 16014,
httpVersion: '1.1',
Expand Down Expand Up @@ -127,7 +125,7 @@ describe('GoodConsole', () => {
reader.once('end', () => {

expect(out.data).to.have.length(1);
expect(out.data[0]).to.be.equal('160318/013330.957, (1458264811279:localhost:16014:ilx17kv4:10001) [response] http://localhost:61253: \u001b[1;33mpost\u001b[0m /data {"name":"adam"} \u001b[32m200\u001b[0m (responseSentTime: 100ms) (responseTime: 150ms)\n');
expect(out.data[0]).to.be.equal('160318/013330.957, (1458264811279:localhost:16014:ilx17kv4:10001) [response] http://localhost:61253: \u001b[1;33mpost\u001b[0m /data {"name":"adam"} \u001b[32m200\u001b[0m (150ms)\n');
done();
});
});
Expand All @@ -148,7 +146,7 @@ describe('GoodConsole', () => {
reader.once('end', () => {

expect(out.data).to.have.length(1);
expect(out.data[0]).to.be.equal('160318/013330.957, (1458264811279:localhost:16014:ilx17kv4:10001) [response] http://localhost:61253: \u001b[1;33mpost\u001b[0m /data \u001b[32m200\u001b[0m (responseSentTime: 100ms) (responseTime: 150ms)\n');
expect(out.data[0]).to.be.equal('160318/013330.957, (1458264811279:localhost:16014:ilx17kv4:10001) [response] http://localhost:61253: \u001b[1;33mpost\u001b[0m /data \u001b[32m200\u001b[0m (150ms)\n');
done();
});
});
Expand All @@ -170,7 +168,7 @@ describe('GoodConsole', () => {
reader.once('end', () => {

expect(out.data).to.have.length(1);
expect(out.data[0]).to.be.equal('160318/013330.957, (1458264811279:localhost:16014:ilx17kv4:10001) [response] http://localhost:61253: \u001b[1;33mpost\u001b[0m /data {"name":"adam"} (responseSentTime: 100ms) (responseTime: 150ms)\n');
expect(out.data[0]).to.be.equal('160318/013330.957, (1458264811279:localhost:16014:ilx17kv4:10001) [response] http://localhost:61253: \u001b[1;33mpost\u001b[0m /data {"name":"adam"} (150ms)\n');
done();
});
});
Expand All @@ -189,7 +187,7 @@ describe('GoodConsole', () => {
reader.once('end', () => {

expect(out.data).to.have.length(1);
expect(out.data[0]).to.be.equal('160318/013330.957, (1458264811279:localhost:16014:ilx17kv4:10001) [response] http://localhost:61253: post /data {"name":"adam"} 200 (responseSentTime: 100ms) (responseTime: 150ms)\n');
expect(out.data[0]).to.be.equal('160318/013330.957, (1458264811279:localhost:16014:ilx17kv4:10001) [response] http://localhost:61253: post /data {"name":"adam"} 200 (150ms)\n');
done();
});
});
Expand All @@ -213,7 +211,7 @@ describe('GoodConsole', () => {
reader.once('end', () => {

expect(out.data).to.have.length(1);
expect(out.data[0]).to.be.equal(`${date}, (1458264811279:localhost:16014:ilx17kv4:10001) [response] http://localhost:61253: \u001b[1;33mpost\u001b[0m /data {"name":"adam"} \u001b[32m200\u001b[0m (responseSentTime: 100ms) (responseTime: 150ms)\n`);
expect(out.data[0]).to.be.equal(`${date}, (1458264811279:localhost:16014:ilx17kv4:10001) [response] http://localhost:61253: \u001b[1;33mpost\u001b[0m /data {"name":"adam"} \u001b[32m200\u001b[0m (150ms)\n`);
done();
});
});
Expand All @@ -235,7 +233,7 @@ describe('GoodConsole', () => {
reader.once('end', () => {

expect(out.data).to.have.length(1);
expect(out.data[0]).to.be.equal('160318/013330.957, (1458264811279:localhost:16014:ilx17kv4:10001) [response] http://localhost:61253: \u001b[1;34mhead\u001b[0m /data {"name":"adam"} \u001b[32m200\u001b[0m (responseSentTime: 100ms) (responseTime: 150ms)\n');
expect(out.data[0]).to.be.equal('160318/013330.957, (1458264811279:localhost:16014:ilx17kv4:10001) [response] http://localhost:61253: \u001b[1;34mhead\u001b[0m /data {"name":"adam"} \u001b[32m200\u001b[0m (150ms)\n');
done();
});
});
Expand All @@ -257,7 +255,7 @@ describe('GoodConsole', () => {
reader.once('end', () => {

expect(out.data).to.have.length(1);
expect(out.data[0]).to.be.equal('160318/013330.957, (1458264811279:localhost:16014:ilx17kv4:10001) [response] http://localhost:61253: \u001b[1;33mpost\u001b[0m /data {"name":"adam"} \u001b[31m599\u001b[0m (responseSentTime: 100ms) (responseTime: 150ms)\n');
expect(out.data[0]).to.be.equal('160318/013330.957, (1458264811279:localhost:16014:ilx17kv4:10001) [response] http://localhost:61253: \u001b[1;33mpost\u001b[0m /data {"name":"adam"} \u001b[31m599\u001b[0m (150ms)\n');
done();
});
});
Expand All @@ -279,7 +277,7 @@ describe('GoodConsole', () => {
reader.once('end', () => {

expect(out.data).to.have.length(1);
expect(out.data[0]).to.be.equal('160318/013330.957, (1458264811279:localhost:16014:ilx17kv4:10001) [response] http://localhost:61253: \u001b[1;33mpost\u001b[0m /data {"name":"adam"} \u001b[33m418\u001b[0m (responseSentTime: 100ms) (responseTime: 150ms)\n');
expect(out.data[0]).to.be.equal('160318/013330.957, (1458264811279:localhost:16014:ilx17kv4:10001) [response] http://localhost:61253: \u001b[1;33mpost\u001b[0m /data {"name":"adam"} \u001b[33m418\u001b[0m (150ms)\n');
done();
});
});
Expand All @@ -301,7 +299,7 @@ describe('GoodConsole', () => {
reader.once('end', () => {

expect(out.data).to.have.length(1);
expect(out.data[0]).to.be.equal('160318/013330.957, (1458264811279:localhost:16014:ilx17kv4:10001) [response] http://localhost:61253: \u001b[1;33mpost\u001b[0m /data {"name":"adam"} \u001b[36m304\u001b[0m (responseSentTime: 100ms) (responseTime: 150ms)\n');
expect(out.data[0]).to.be.equal('160318/013330.957, (1458264811279:localhost:16014:ilx17kv4:10001) [response] http://localhost:61253: \u001b[1;33mpost\u001b[0m /data {"name":"adam"} \u001b[36m304\u001b[0m (150ms)\n');
done();
});
});
Expand Down

0 comments on commit c8823c0

Please sign in to comment.