How to get number of succeeded jobs and failed jobs in a Batch

Given a BatchID, is there any way to count the number of jobs in the batch? Is there any way to count the number of succeeded jobs and number of failed jobs in the batch?

Thanks!