public void save_statistics() {
    /**
     * * There's a mistake here... we are saving total account wall time ** (i.e. the sum of account
     * wall times...which may have overlapped in time), ** instead of the walltime of the billrun. *
     */
    BICServerLog.debugMsg(
        "BillRunTabulator(" + billrun.get_billrunid() + ").save_statistics(): entered.");

    /**
     * * Compute total total wall time and total cpu time: ** sum the local and foreign times for
     * each. *
     */
    total_wall_time = total_local_wall_time + total_foreign_wall_time;
    total_cpu_time = total_local_cpu_time + total_foreign_cpu_time;

    try {
      AdminCatalogOpCenterDAO.save_billrun_stats(
          billrun.get_billrunid(),
          total_wall_time,
          total_cpu_time,
          num_todo,
          num_accounts_bip_succeeded,
          num_accounts_bip_failed,
          num_accounts_limboed,
          0,
          "Place your BillRun(" + billrun.get_billrunid() + ") commentary here.");
    } catch (Exception e) {
      BICServerLog.printStackTrace(e);
      BICServerLog.infoMsg(
          "BillRunTabulator("
              + billrun.get_billrunid()
              + ").save_statistics(): caught exception while saving the bill run statistics."
              + e);
    }

    /**
     * * Cannot save machine stats because the table BILLRUN_MACHINE_STATS ** does not contain the
     * hostname as a field in the table. *
     */
    // AdminCatalogOpCenterDAO.save_billrun_...
  }
  public void tally_accounts_bip_status(Collection accounts) {
    Account account;
    Iterator tour;

    BICServerLog.debugMsg(
        "BillRunTabulator("
            + billrun.get_billrunid()
            + ").tally_accounts_bip_status(): entered with accounts.size() = "
            + accounts.size());
    tour = accounts.iterator();
    while (tour.hasNext()) {
      account = (Account) tour.next();
      tally_account_bip_status(account);
    }
    return;
  }
  public void tally_account_bip_status(Account account) {
    try {
      if (account.is_bipstatus(Account.SUCCEEDED)) {
        ++num_accounts_bip_succeeded;
        if (account.was_local_run()) {
          total_local_cpu_time += account.get_final_cpu_time();
          total_local_wall_time += account.get_final_wall_time();
        } else {
          total_foreign_cpu_time += account.get_final_cpu_time();
          total_foreign_wall_time += account.get_final_wall_time();
        }
      } else if (account.is_bipstatus(Account.FAILED)) ++num_accounts_bip_failed;
      else if (account.is_bipstatus(Account.SKIPPED)) ++num_accounts_bip_skipped;
    } catch (Exception e) {
      BICServerLog.infoMsg("tally_account_bip_status() caught Exception." + e);
    }

    return;
  }