From 3ab67b9c30cf413c2b40f4b636418fec475c434a Mon Sep 17 00:00:00 2001 From: Chris Evich Date: Thu, 4 Apr 2019 13:55:18 -0400 Subject: Cirrus: timestamp all output script output Also remove direct time-stamping by CI scripts that would compete. Signed-off-by: Chris Evich --- contrib/cirrus/timestamp.awk | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 contrib/cirrus/timestamp.awk (limited to 'contrib/cirrus/timestamp.awk') diff --git a/contrib/cirrus/timestamp.awk b/contrib/cirrus/timestamp.awk new file mode 100644 index 000000000..95b312e51 --- /dev/null +++ b/contrib/cirrus/timestamp.awk @@ -0,0 +1,20 @@ + + +# This script is intended to be piped into by automation, in order to +# mark output lines with timing information. For example: +# /path/to/command |& awk --file timestamp.awk + +BEGIN { + STARTTIME=systime() + printf "[%s] START", strftime("%T") + printf " - All [+xxxx] lines that follow are relative to right now.\n" +} + +{ + printf "[%+05ds] %s\n", systime()-STARTTIME, $0 +} + +END { + printf "[%s] END", strftime("%T") + printf " - [%+05ds] total duration since START\n", systime()-STARTTIME +} -- cgit v1.2.3-54-g00ecf