Add Timing Data to Each Output Line

Debugging where jobs spend most of their time can be useful to help optimise your pipeline, along with debugging spikes in job completion time.

Generally, logging timing data is up to the command that is being run at the time, but we can manually add this by using some bash scripting.

See the below example for how you can achieve this:

- run: example_command | while read line ; do echo "$(date +"%T") > $line" ; done ;

This will provide and output along the following lines:

21:15:46 > Some Output Line 1
21:16:12 > Some Output Line 2
21:17:41 > Some Output Line 3

The format of the timing data is in HH:MM:SS which provides granular information that will help in tracking down steps that are taking longer than expected.

Was this article helpful?
1 out of 1 found this helpful



Article is closed for comments.