code: def _monitor_pbc_status(self):
          
          LOG.info('Starting to Monitor PBC status.')
          inspect = celery.current_app.control.inspect()
          workers = inspect.ping()
          start_time = time.time()
          while workers is None:
              time.sleep(0.1)
              elapsed = time.time() - start_time
              if elapsed > 20.0:
                  LOG.warning('PBC not found!')
                  break
          if workers is not None:
              for worker in workers:
                  _tasks = inspect.registered_tasks()[worker]
                  LOG.info('Worker: %s tasks:', worker)
                  for task_index, task_name in enumerate(_tasks):
                      LOG.info('  %02d : %s', task_index, task_name)
  
          while True:
              LOG.info('Checking PBC status (%d/%d)', self._num_pbcs,
                       self._max_pbcs)
              celery_app = celery.current_app
              inspect = celery_app.control.inspect()
              workers = inspect.ping()
              if workers is None:
                  LOG.warning('PBC service not found!')
              else:
                  LOG.info('PBC state:  %s', celery_app.events.State())
                  _active = inspect.active()
                  _scheduled = inspect.scheduled()
                  for worker in workers:
                      LOG.info('  Worker %s: scheduled: %s, active: %s',
                               worker, _active[worker], _scheduled[worker])
              time.sleep(self._report_interval)
docs: Monitor the PBC status.