class ApiResponseCounter implements MeterBinder {

  public void handleStatus(int status) {
    status = status / 100;
    switch (status) {
      case 1:
        informationalResponseCounter.increment();
        break;
      case 2:
        successResponseCounter.increment();
        break;
      case 3:
        redirectResponseCounter.increment();
        break;
      case 4:
        clientErrorResponseCounter.increment();
        break;
      case 5:
        serverErrorResponseCounter.increment();
        break;
      default:
        // should not happen
        LOG.warn("Unhandled HTTP status ", status);
    }
  }

}