Skip to content

Commit

Permalink
fix: print number of pages and files
Browse files Browse the repository at this point in the history
  • Loading branch information
razonyang committed Jun 14, 2024
1 parent a8b315b commit 1a3029e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/metrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,11 @@ class Metrics {

speed (): string {
const totalPages = this.pages + this.paginatorPages
const pagesWithAliases = totalPages + this.aliases
return `${this.colorSpeed(this.time / totalPages)} ms/page
${this.colorSpeed(this.time / pagesWithAliases)} ms/page (including aliases)
${this.colorSpeed(this.time / (pagesWithAliases + this.staticFiles + this.nonPageFiles + this.processedImages))} ms/file (all pages and files)`
const totalPagesAliases = totalPages + this.aliases
const totalFiles = totalPagesAliases + this.staticFiles + this.nonPageFiles + this.processedImages
return `${this.colorSpeed(this.time / totalPages)} ms/page (${blue(totalPages)} pages)
${this.colorSpeed(this.time / totalPagesAliases)} ms/page (${blue(totalPagesAliases)} pages, including aliases)
${this.colorSpeed(this.time / totalFiles)} ms/file (${blue(totalFiles)} files)`
}

private colorSpeed (speed: number): string {
Expand Down

0 comments on commit 1a3029e

Please sign in to comment.