INNER CODE UNIT · JavaScript
percent
puppeteer/examples · code_coverage.js:63
const percent = Math.round((used / total) * 100);
return `${formatBytesToKB(used)}/${formatBytesToKB(total)} (${percent}%)`;
}
shortSummary(used, total = this.stats.totalBytes) {
const percent = Math.round((used / total) * 100);
return used ? `${formatBytesToKB(used)} (${percent}%)` : 0;
}
/**
* Constructors a bar chart for the % usage of each value.
* @param {!{jsUsed: number, cssUsed: number, totalBytes: number}=} stats Usage stats.
* @return {string}
*/
barGraph(stats = this.stats) {
// const MAX_TERMINAL_CHARS = process.stdout.columns;
const maxBarWidth = 30;