AsyncApexJob a = [SELECT Id, Status, NumberOfErrors, JobItemsProcessed, TotalJobItems, CreatedBy.Email FROM AsyncApexJob WHERE Id = :BC.getJobId()]
Do similar query in finish() method, BC is the instance of BatchableContext. NumberOfErrors is the number of failed batches and subtract it from JobItemsProcessed to get the number of successful batches.
Here you can see Total batches and Batches Proccessed, if all batches are processed properly, this is called all batches are running sucessfully. On the other any batch failure it will show you failure list.
Do similar query in finish() method, BC is the instance of BatchableContext. NumberOfErrors is the number of failed batches and subtract it from JobItemsProcessed to get the number of successful batches.
Going to Setup > Quick find/Search box > Apex job
Here you can see Total batches and Batches Proccessed, if all batches are processed properly, this is called all batches are running sucessfully. On the other any batch failure it will show you failure list.
Thanks