onFailure(endpoint) {
    const state = this.states[endpoint];
    state.failures += 1;
    if (state.failures > this.failureThreshold) {
      state.circuit = 'OPEN';
      state.nextTry = new Date() / 1000 + this.cooldownPeriod;
      console.log(`ALERT! Circuit for ${endpoint} is in state 'OPEN'`);
    }
  }
/** on a failed request record this and see if ciruit should be set to open
   * @param  {string} endpoint
   */
on a failed request record this and see if ciruit should be set to open
@param  {string} endpoint
on a failed request record this and see if ciruit should be set to open @param { string } endpoint
onFailure(endpoint) {
    const state = this.states[endpoint];
    state.failures += 1;
    if (state.failures > this.failureThreshold) {
      state.circuit = 'OPEN';
      state.nextTry = new Date() / 1000 + this.cooldownPeriod;
      console.log(`ALERT! Circuit for ${endpoint} is in state 'OPEN'`);
    }
  }
onFailure ( endpoint ) { const state = this . states [ endpoint ] ; state . failures += 1 ; if ( state . failures > this . failureThreshold ) { state . circuit = 'OPEN' ; state . nextTry = new Date ( ) / 1000 + this . cooldownPeriod ; console . log ( ` ${ endpoint } ` ) ; } }
on a failed request record this and see if ciruit should be set to open
 @param  {string} endpoint
on a failed request record this and see if ciruit should be set to open @param { string } endpoint