Exemplo n.º 1
0
function printResults(parsedDataSize, startDate, endDate, heapDiff, maxMemUsage) {
    console.log('Input data size:', format(parsedDataSize, { unit: 'B' }));
    console.log('Duration: ', getDuration(startDate, endDate));
    console.log('Memory before: ', heapDiff.before.size);
    console.log('Memory after: ', heapDiff.after.size);
    console.log('Memory max: ', format(maxMemUsage, { unit: 'B' }));
}
Exemplo n.º 2
0
 return function (row) {
     var id = row.id.slice(0,6);
     var pid = row.parent.slice(0,6);
     return {
         '.id': id,
         '.id-color': { style: 'background-color: #' + id },
         '.parent': pid,
         '.parent-color': { style: 'background-color: #' + pid },
         '.fork': row.parent ? {} : { style: 'display: none' },
         '.tag': row.repoTags || [],
         '.disk-size': humanize(row.size),
         '.virtual-size': humanize(row.virtualSize)
     };
 };
Exemplo n.º 3
0
function printProgress (progress) {
  if (progress.length) {
    console.warn(
      '%s% of %s @ %s/s - ETA %s',
      Math.round(progress.percentage),
      humanFormat(progress.length, humanFormatOpts),
      humanFormat(progress.speed, humanFormatOpts),
      prettyMs(progress.eta * 1e3)
    )
  } else {
    console.warn(
      '%s @ %s/s',
      humanFormat(progress.transferred, humanFormatOpts),
      humanFormat(progress.speed, humanFormatOpts)
    )
  }
}
Exemplo n.º 4
0
function getDuration(startDate, endDate) {
    const scale = new format.Scale({
        seconds: 1,
        minutes: 60,
        hours: 3600
    });

    return format((endDate - startDate) / 1000, { scale: scale });
}
Exemplo n.º 5
0
 parsed.files.forEach(function (file) {
   var prefix = ''
   if (argv.s && argv.h) {
     prefix = humanSize(file.length).replace(/(\d)B$/, '$1 B')
     prefix = Array(10 - prefix.length).join(' ') + prefix + ' '
   } else if (argv.s) {
     prefix = String(file.length)
     prefix = Array(10 - prefix.length).join(' ') + prefix + ' '
   }
   console.log(prefix + file.path)
 })
Exemplo n.º 6
0
 valueTransform: value =>
   humanFormat(value, {
     decimals: 3,
     unit: 'IOPS',
   }),