change in stat storage

mochawesome
John McLear 2021-01-28 13:11:24 +00:00
parent 3caedd370e
commit d01aafb98c
1 changed files with 2 additions and 2 deletions

View File

@ -48,8 +48,6 @@ let started = false;
let stopped = false; let stopped = false;
exports.start = async () => { exports.start = async () => {
let startDurations = {};
stats.gauge('startDurations', () => durations);
if (started) return express.server; if (started) return express.server;
started = true; started = true;
if (stopped) throw new Error('restart not supported'); if (stopped) throw new Error('restart not supported');
@ -59,6 +57,8 @@ exports.start = async () => {
// start up stats counting system // start up stats counting system
const stats = require('./stats'); const stats = require('./stats');
let startDurations = {};
stats.gauge('startDurations', () => durations);
stats.gauge('memoryUsage', () => process.memoryUsage().rss); stats.gauge('memoryUsage', () => process.memoryUsage().rss);
stats.gauge('memoryUsageHeap', () => process.memoryUsage().heapUsed); stats.gauge('memoryUsageHeap', () => process.memoryUsage().heapUsed);