mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-01 05:50:35 +03: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
@ -31,6 +31,7 @@ const context = require('./fixtures/context');
|
||||
let ghostServer;
|
||||
let existingData = {};
|
||||
let totalStartTime = 0;
|
||||
let totalBoots = 0;
|
||||
|
||||
/**
|
||||
* Because we use ObjectID we don't know the ID of fixtures ahead of time
|
||||
@ -210,8 +211,10 @@ const startGhost = async (options) => {
|
||||
// Reporting
|
||||
const totalTime = Date.now() - startTime;
|
||||
totalStartTime += totalTime;
|
||||
totalBoots += 1;
|
||||
const averageBootTime = Math.round(totalStartTime / totalBoots);
|
||||
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;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user