determinePeerHealth (verboseHealthCheckResp) {
    // Check for sufficient minimum storage size
    const { storagePathSize, storagePathUsed } = verboseHealthCheckResp
    if (storagePathSize && storagePathUsed && storagePathSize - storagePathUsed <= MINIMUM_STORAGE_PATH_SIZE) {
      throw new Error(`Almost out of storage=${storagePathSize - storagePathUsed}bytes remaining. Minimum storage required=${MINIMUM_STORAGE_PATH_SIZE}bytes`)
    }

    // Check for sufficient memory space
    const { usedMemory, totalMemory } = verboseHealthCheckResp
    if (usedMemory && totalMemory && totalMemory - usedMemory <= MINIMUM_MEMORY_AVAILABLE) {
      throw new Error(`Running low on memory=${totalMemory - usedMemory}bytes remaining. Minimum memory required=${MINIMUM_MEMORY_AVAILABLE}bytes`)
    }

    // Check for sufficient file descriptors space
    const { allocatedFileDescriptors, maxFileDescriptors } = verboseHealthCheckResp
    if (allocatedFileDescriptors && maxFileDescriptors && allocatedFileDescriptors / maxFileDescriptors >= MAX_FILE_DESCRIPTORS_ALLOCATED_PERCENTAGE) {
      throw new Error(`Running low on file descriptors availability=${allocatedFileDescriptors / maxFileDescriptors * 100}% used. Max file descriptors allocated percentage allowed=${MAX_FILE_DESCRIPTORS_ALLOCATED_PERCENTAGE * 100}%`)
    }

    // Check historical sync data for current day
    const { dailySyncSuccessCount, dailySyncFailCount } = verboseHealthCheckResp
    if (dailySyncSuccessCount &&
      dailySyncFailCount &&
      dailySyncSuccessCount + dailySyncFailCount > MINIMUM_DAILY_SYNC_COUNT &&
      dailySyncSuccessCount / (dailySyncFailCount + dailySyncSuccessCount) < MINIMUM_SUCCESSFUL_SYNC_COUNT_PERCENTAGE) {
      throw new Error(`Latest daily sync data shows that this node fails at a high rate of syncs. Successful syncs=${dailySyncSuccessCount} || Failed syncs=${dailySyncFailCount}. Minimum successful sync percentage=${MINIMUM_SUCCESSFUL_SYNC_COUNT_PERCENTAGE * 100}%`)
    }

    // Check historical sync data for rolling window 30 days
    const { thirtyDayRollingSyncSuccessCount, thirtyDayRollingSyncFailCount } = verboseHealthCheckResp
    if (thirtyDayRollingSyncSuccessCount &&
      thirtyDayRollingSyncFailCount &&
      thirtyDayRollingSyncSuccessCount + thirtyDayRollingSyncFailCount > MINIMUM_ROLLING_SYNC_COUNT &&
      thirtyDayRollingSyncSuccessCount / (thirtyDayRollingSyncFailCount + thirtyDayRollingSyncSuccessCount) < MINIMUM_SUCCESSFUL_SYNC_COUNT_PERCENTAGE) {
      throw new Error(`Rolling sync data shows that this node fails at a high rate of syncs. Successful syncs=${thirtyDayRollingSyncSuccessCount} || Failed syncs=${thirtyDayRollingSyncFailCount}. Minimum successful sync percentage=${MINIMUM_SUCCESSFUL_SYNC_COUNT_PERCENTAGE * 100}%`)
    }
  }
/**
   * Takes data off the verbose health check response and determines the peer heatlh
   * @param {Object} verboseHealthCheckResp verbose health check response
   *
   * TODO: consolidate CreatorNodeSelection + peer set health check calculation logic
   */
Takes data off the verbose health check response and determines the peer heatlh
@param {Object} verboseHealthCheckResp verbose health check response

consolidate CreatorNodeSelection + peer set health check calculation logic
Takes data off the verbose health check response and determines the peer heatlh @param { Object } verboseHealthCheckResp verbose health check response consolidate CreatorNodeSelection + peer set health check calculation logic
determinePeerHealth (verboseHealthCheckResp) {
    const { storagePathSize, storagePathUsed } = verboseHealthCheckResp
    if (storagePathSize && storagePathUsed && storagePathSize - storagePathUsed <= MINIMUM_STORAGE_PATH_SIZE) {
      throw new Error(`Almost out of storage=${storagePathSize - storagePathUsed}bytes remaining. Minimum storage required=${MINIMUM_STORAGE_PATH_SIZE}bytes`)
    }
    const { usedMemory, totalMemory } = verboseHealthCheckResp
    if (usedMemory && totalMemory && totalMemory - usedMemory <= MINIMUM_MEMORY_AVAILABLE) {
      throw new Error(`Running low on memory=${totalMemory - usedMemory}bytes remaining. Minimum memory required=${MINIMUM_MEMORY_AVAILABLE}bytes`)
    }
    const { allocatedFileDescriptors, maxFileDescriptors } = verboseHealthCheckResp
    if (allocatedFileDescriptors && maxFileDescriptors && allocatedFileDescriptors / maxFileDescriptors >= MAX_FILE_DESCRIPTORS_ALLOCATED_PERCENTAGE) {
      throw new Error(`Running low on file descriptors availability=${allocatedFileDescriptors / maxFileDescriptors * 100}% used. Max file descriptors allocated percentage allowed=${MAX_FILE_DESCRIPTORS_ALLOCATED_PERCENTAGE * 100}%`)
    }
    const { dailySyncSuccessCount, dailySyncFailCount } = verboseHealthCheckResp
    if (dailySyncSuccessCount &&
      dailySyncFailCount &&
      dailySyncSuccessCount + dailySyncFailCount > MINIMUM_DAILY_SYNC_COUNT &&
      dailySyncSuccessCount / (dailySyncFailCount + dailySyncSuccessCount) < MINIMUM_SUCCESSFUL_SYNC_COUNT_PERCENTAGE) {
      throw new Error(`Latest daily sync data shows that this node fails at a high rate of syncs. Successful syncs=${dailySyncSuccessCount} || Failed syncs=${dailySyncFailCount}. Minimum successful sync percentage=${MINIMUM_SUCCESSFUL_SYNC_COUNT_PERCENTAGE * 100}%`)
    }
    const { thirtyDayRollingSyncSuccessCount, thirtyDayRollingSyncFailCount } = verboseHealthCheckResp
    if (thirtyDayRollingSyncSuccessCount &&
      thirtyDayRollingSyncFailCount &&
      thirtyDayRollingSyncSuccessCount + thirtyDayRollingSyncFailCount > MINIMUM_ROLLING_SYNC_COUNT &&
      thirtyDayRollingSyncSuccessCount / (thirtyDayRollingSyncFailCount + thirtyDayRollingSyncSuccessCount) < MINIMUM_SUCCESSFUL_SYNC_COUNT_PERCENTAGE) {
      throw new Error(`Rolling sync data shows that this node fails at a high rate of syncs. Successful syncs=${thirtyDayRollingSyncSuccessCount} || Failed syncs=${thirtyDayRollingSyncFailCount}. Minimum successful sync percentage=${MINIMUM_SUCCESSFUL_SYNC_COUNT_PERCENTAGE * 100}%`)
    }
  }
determinePeerHealth ( verboseHealthCheckResp ) { const { storagePathSize , storagePathUsed } = verboseHealthCheckResp if ( storagePathSize && storagePathUsed && storagePathSize - storagePathUsed <= MINIMUM_STORAGE_PATH_SIZE ) { throw new Error ( ` ${ storagePathSize - storagePathUsed } ${ MINIMUM_STORAGE_PATH_SIZE } ` ) } const { usedMemory , totalMemory } = verboseHealthCheckResp if ( usedMemory && totalMemory && totalMemory - usedMemory <= MINIMUM_MEMORY_AVAILABLE ) { throw new Error ( ` ${ totalMemory - usedMemory } ${ MINIMUM_MEMORY_AVAILABLE } ` ) } const { allocatedFileDescriptors , maxFileDescriptors } = verboseHealthCheckResp if ( allocatedFileDescriptors && maxFileDescriptors && allocatedFileDescriptors / maxFileDescriptors >= MAX_FILE_DESCRIPTORS_ALLOCATED_PERCENTAGE ) { throw new Error ( ` ${ allocatedFileDescriptors / maxFileDescriptors * 100 } ${ MAX_FILE_DESCRIPTORS_ALLOCATED_PERCENTAGE * 100 } ` ) } const { dailySyncSuccessCount , dailySyncFailCount } = verboseHealthCheckResp if ( dailySyncSuccessCount && dailySyncFailCount && dailySyncSuccessCount + dailySyncFailCount > MINIMUM_DAILY_SYNC_COUNT && dailySyncSuccessCount / ( dailySyncFailCount + dailySyncSuccessCount ) < MINIMUM_SUCCESSFUL_SYNC_COUNT_PERCENTAGE ) { throw new Error ( ` ${ dailySyncSuccessCount } ${ dailySyncFailCount } ${ MINIMUM_SUCCESSFUL_SYNC_COUNT_PERCENTAGE * 100 } ` ) } const { thirtyDayRollingSyncSuccessCount , thirtyDayRollingSyncFailCount } = verboseHealthCheckResp if ( thirtyDayRollingSyncSuccessCount && thirtyDayRollingSyncFailCount && thirtyDayRollingSyncSuccessCount + thirtyDayRollingSyncFailCount > MINIMUM_ROLLING_SYNC_COUNT && thirtyDayRollingSyncSuccessCount / ( thirtyDayRollingSyncFailCount + thirtyDayRollingSyncSuccessCount ) < MINIMUM_SUCCESSFUL_SYNC_COUNT_PERCENTAGE ) { throw new Error ( ` ${ thirtyDayRollingSyncSuccessCount } ${ thirtyDayRollingSyncFailCount } ${ MINIMUM_SUCCESSFUL_SYNC_COUNT_PERCENTAGE * 100 } ` ) } }
Takes data off the verbose health check response and determines the peer heatlh
 @param {Object} verboseHealthCheckResp verbose health check response
Takes data off the verbose health check response and determines the peer heatlh @param { Object } verboseHealthCheckResp verbose health check response
// Check for sufficient minimum storage size // Check for sufficient memory space // Check for sufficient file descriptors space // Check historical sync data for current day // Check historical sync data for rolling window 30 days