mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-03 23:00:14 -05:00
Added number of server boots to test reporting
no issue - this commit adds a counter for the number of boots we do in tests - which therefore allows us to calculate the average boot time we experience - only useful for debugging test performance
This commit is contained in:
parent
ff89cd74bc
commit
617fec71cb
1 changed files with 4 additions and 1 deletions
|
@ -31,6 +31,7 @@ const context = require('./fixtures/context');
|
||||||
let ghostServer;
|
let ghostServer;
|
||||||
let existingData = {};
|
let existingData = {};
|
||||||
let totalStartTime = 0;
|
let totalStartTime = 0;
|
||||||
|
let totalBoots = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Because we use ObjectID we don't know the ID of fixtures ahead of time
|
* Because we use ObjectID we don't know the ID of fixtures ahead of time
|
||||||
|
@ -210,8 +211,10 @@ const startGhost = async (options) => {
|
||||||
// Reporting
|
// Reporting
|
||||||
const totalTime = Date.now() - startTime;
|
const totalTime = Date.now() - startTime;
|
||||||
totalStartTime += totalTime;
|
totalStartTime += totalTime;
|
||||||
|
totalBoots += 1;
|
||||||
|
const averageBootTime = Math.round(totalStartTime / totalBoots);
|
||||||
debug(`Started Ghost in ${totalTime / 1000}s`);
|
debug(`Started Ghost in ${totalTime / 1000}s`);
|
||||||
debug(`Accumulated start time is ${totalStartTime / 1000}s`);
|
debug(`Accumulated start time across ${totalBoots} boots is ${totalStartTime / 1000}s (average = ${averageBootTime}ms)`);
|
||||||
return ghostServer;
|
return ghostServer;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue