helper functions to compile job stats into json