add type hinting and error handing to workload generator

Change-Id: I7fae16b00b635fa91e40f8426f995a25fd2bcf07