class QueryStateListener implements ErrorStateListener {

  @Override
  public void onChange(final State newState, final State oldState) {
    state = newState.toString();
    currentState = newState;

    if (newState != State.ERROR) {
      this.error = NO_ERROR;
    }

    if (newState.isRunningOrRebalancing() && !oldState.isRunningOrRebalancing()) {
      runningSince = ticker.read();
    }
  }

    QueryStateListener(
      final Metrics metrics,
      final String groupPrefix,
      final String queryApplicationId
  );
    QueryStateListener(
      final Metrics metrics,
      final String groupPrefix,
      final String queryApplicationId,
      final Ticker ticker
  );

}