Skip to content

Commit

Permalink
ci: fix benchmark output format
Browse files Browse the repository at this point in the history
  • Loading branch information
SukkaW committed Oct 20, 2019
1 parent bf03ad8 commit 27b89c1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/benchmark.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/bin/sh

_SUBSTRUCTION () {
echo | awk "{print $1-$2}"
echo | awk "{printf \"%.3f\", $1-$2}"
}

_MESSAGE_FORMATTER () {
awk '{printf "| %-29s | %7.3f |\n",$1" "$2,$3}'
awk '{printf "| %-28s | %9s |\n",$1" "$2,$3}'
}

LOG_TABLE () {
Expand All @@ -22,7 +22,7 @@ LOG_TABLE () {
echo "Render Files $(_SUBSTRUCTION $time_render_finish $time_render_start)s" | _MESSAGE_FORMATTER
echo "Save Database $(_SUBSTRUCTION $time_database_saved $time_render_finish)s" | _MESSAGE_FORMATTER
echo "Total time $(_SUBSTRUCTION $time_database_saved $time_begin)s" | _MESSAGE_FORMATTER
echo "Memory Usage(RSS) $(echo | awk "{print $memory_usage/1024}")MB" | _MESSAGE_FORMATTER
echo "Memory Usage(RSS) $(echo | awk "{printf \"%.3f\", $memory_usage/1024}")MB" | _MESSAGE_FORMATTER
}

echo "============== Hexo Benchmark =============="
Expand Down

0 comments on commit 27b89c1

Please sign in to comment.