code: def check_available(self):
          
          success = True
          start_time = datetime.datetime.utcnow()
          message = ''
          LOGGER.debug('Checking layer id %s' % self.id)
  
          signals.post_save.disconnect(layer_post_save, sender=Layer)
  
          try:
              self.update_thumbnail()
          except ValueError, err:
              # caused by update_thumbnail()
              # self.href is empty in arcserver.ExportMap
              if str(err).startswith("unknown url type:"):
                  LOGGER.debug('Thumbnail can not be updated: %s' % str(err))
          except Exception, err:
              message = str(err)
              success = False
  
          signals.post_save.connect(layer_post_save, sender=Layer)
  
          end_time = datetime.datetime.utcnow()
  
          delta = end_time - start_time
          response_time = '%s.%s' % (delta.seconds, delta.microseconds)
  
          check = Check(
              content_object=self,
              success=success,
              response_time=response_time,
              message=message
          )
          check.save()
          LOGGER.debug('Layer checked in %s seconds, status is %s' % (response_time, success))
          return success, message
docs: Check for availability of a layer and provide run metrics.