code: public void sessionEnd(SessionStatus finishState) {
      if (sessionStatusToMetrics.containsKey(finishState)) {
        sessionStatusToMetrics.get(finishState).inc();
      } else {
        throw new IllegalArgumentException("Invalid end state " + finishState);
      }
    }
docs: Record the end of a session.
  @param finishState The state that the session finished in.