function generateLogObject() {
  return new Promise((resolve, reject) => {
    const obj = JSON.parse(JSON.stringify(k));
    const promises = [
      new Promise((resolve, reject) => {
        jobQueue.activeCount((err, n) => resolve(n || 0));
      }),
      new Promise((resolve, reject) => {
        jobQueue.completeCount((err, n) => resolve(n || 0));
      }),
      new Promise((resolve, reject) => {
        jobQueue.failedCount((err, n) => resolve(n || 0));
      }),
      new Promise((resolve, reject) => {
        jobQueue.inactiveCount((err, n) => resolve(n || 0));
      }),
      new Promise((resolve, reject) => {
        jobQueue.workTime((err, ms) => resolve(ms || 0));
      }),
    ];
    Promise.all(promises)
    .then((res) => {
      obj.activeCount = res[0];
      obj.completeCount = res[1];
      obj.failedCount = res[2];
      obj.inactiveCount = res[3];
      obj.workTimeMillis = res[4];
      resolve(obj);
    });
  });
} // generateLogObject
/**
 * Generate the logging object. (Separating this out and exporting for easier
 * testing.)
 *
 * @returns {Object} logging object
 */
Generate the logging object. (Separating this out and exporting for easier
testing.)

@returns {Object} logging object
Generate the logging object . ( Separating this out and exporting for easier testing . ) @returns { Object } logging object
function generateLogObject() {
  return new Promise((resolve, reject) => {
    const obj = JSON.parse(JSON.stringify(k));
    const promises = [
      new Promise((resolve, reject) => {
        jobQueue.activeCount((err, n) => resolve(n || 0));
      }),
      new Promise((resolve, reject) => {
        jobQueue.completeCount((err, n) => resolve(n || 0));
      }),
      new Promise((resolve, reject) => {
        jobQueue.failedCount((err, n) => resolve(n || 0));
      }),
      new Promise((resolve, reject) => {
        jobQueue.inactiveCount((err, n) => resolve(n || 0));
      }),
      new Promise((resolve, reject) => {
        jobQueue.workTime((err, ms) => resolve(ms || 0));
      }),
    ];
    Promise.all(promises)
    .then((res) => {
      obj.activeCount = res[0];
      obj.completeCount = res[1];
      obj.failedCount = res[2];
      obj.inactiveCount = res[3];
      obj.workTimeMillis = res[4];
      resolve(obj);
    });
  });
} 
function generateLogObject ( ) { return new Promise ( ( resolve , reject ) => { const obj = JSON . parse ( JSON . stringify ( k ) ) ; const promises = [ new Promise ( ( resolve , reject ) => { jobQueue . activeCount ( ( err , n ) => resolve ( n || 0 ) ) ; } ) , new Promise ( ( resolve , reject ) => { jobQueue . completeCount ( ( err , n ) => resolve ( n || 0 ) ) ; } ) , new Promise ( ( resolve , reject ) => { jobQueue . failedCount ( ( err , n ) => resolve ( n || 0 ) ) ; } ) , new Promise ( ( resolve , reject ) => { jobQueue . inactiveCount ( ( err , n ) => resolve ( n || 0 ) ) ; } ) , new Promise ( ( resolve , reject ) => { jobQueue . workTime ( ( err , ms ) => resolve ( ms || 0 ) ) ; } ) , ] ; Promise . all ( promises ) . then ( ( res ) => { obj . activeCount = res [ 0 ] ; obj . completeCount = res [ 1 ] ; obj . failedCount = res [ 2 ] ; obj . inactiveCount = res [ 3 ] ; obj . workTimeMillis = res [ 4 ] ; resolve ( obj ) ; } ) ; } ) ; }
Generate the logging object.
Generate the logging object .
// generateLogObject