mirror of
https://github.com/Kong/insomnia.git
synced 2026-05-24 16:51:06 -04:00
Add response time in api response to test latency (#3465)
* Add response time in api response to test latency * linting fixes Co-authored-by: Eric Reynolds <eric.reynolds@konghq.com>
This commit is contained in:
committed by
Opender Singh
parent
1147f273d8
commit
566ca93bad
@@ -4,6 +4,10 @@ import { send } from '../network/network';
|
||||
import { getBodyBuffer } from '../models/response';
|
||||
import * as plugins from '../plugins';
|
||||
|
||||
function toMs(num) {
|
||||
return Math.round(num * 1000) / 1000;
|
||||
}
|
||||
|
||||
export async function getSendRequestCallbackMemDb(environmentId, memDB) {
|
||||
// Initialize the DB in-memory and fill it with data if we're given one
|
||||
await db.init(
|
||||
@@ -55,6 +59,7 @@ async function sendAndTransform(requestId, environmentId) {
|
||||
statusMessage: res.statusMessage,
|
||||
data: bodyBuffer ? bodyBuffer.toString('utf8') : undefined,
|
||||
headers: headersObj,
|
||||
responseTime: toMs(res.elapsedTime),
|
||||
};
|
||||
} finally {
|
||||
plugins.clearIgnores();
|
||||
|
||||
Reference in New Issue
Block a user