예제 #1
0
 /**
  * Add the newly collected stats to the average objects so the average over the run can be
  * calculated.
  *
  * @param stats the stats to add to the average object
  */
 private void addToAvg(HCPerfStats stats) {
   addToAvg(STORE_BOTH_LABEL, avgStoreBoth, stats.getStoreBoth());
   addToAvg(STORE_MD_LABEL, avgStoreMd, stats.getStoreMd());
   addToAvg(STORE_MD_SIDE_LABEL, avgStoreMdSide, stats.getStoreMdSide());
   addToAvg(STORE_ONLY_LABEL, avgStoreOnly, stats.getStoreOnly());
   addToAvg(RETRIEVE_ONLY_LABEL, avgRetrieveOnly, stats.getRetrieveOnly());
   addToAvg(RETRIEVE_MD_LABEL, avgRetrieveMd, stats.getRetrieveMd());
   addToAvg(QUERY_LABEL, avgQuery, stats.getQuery());
   addToAvg(DELETE_LABEL, avgDelete, stats.getDelete());
   addToAvg(SCHEMA_LABEL, avgSchema, stats.getSchema());
   addToAvg(WEBDAV_GET_LABEL, avgWebdavGet, stats.getWebdavGet());
   addToAvg(WEBDAV_PUT_LABEL, avgWebdavPut, stats.getWebdavPut());
 }
예제 #2
0
  private void printDatabaseStats(HCPerfStats stats, boolean printAll) {
    if (printAll) {
      System.out.println(
          "                     Avg.      Avg        Avg.   Run Avg.  Run Avg.   Run Avg.");
      System.out.println(
          "                    Op/sec  Resp Time     KB/sec  Op/sec   Resp Time   KB/sec");
      System.out.println(
          allStatsFormatter.sprintf(
              new String[] {
                "", "--------", "----------", "----------", "--------", "----------", "----------",
              }));
    } else {
      System.out.println("                               Avg           Avg");
      System.out.println("                     # Ops    Op/sec       KB/sec");
      System.out.println(
          statsFormatter.sprintf(
              new String[] {
                "", "--------", "----------", "------------",
              }));
    }
    if (printAll) {
      printDatabasePerfElement(STORE_ONLY_LABEL, stats.getStoreOnly(), avgStoreOnly, printAll);
    }
    printDatabasePerfElement(STORE_MD_LABEL, stats.getStoreMd(), avgStoreMd, printAll);

    // Don't output this stat for now.  It's different than
    // all the other stats since it's the MD portion of
    // Store Both.
    /*
    if (printAll) {
        printDatabasePerfElement(STORE_MD_SIDE_LABEL,
    	stats.getStoreMdSide(), avgStoreMdSide, printAll);
    }
     */
    printDatabasePerfElement(STORE_BOTH_LABEL, stats.getStoreBoth(), avgStoreBoth, printAll);
    printDatabasePerfElement(
        RETRIEVE_ONLY_LABEL, stats.getRetrieveOnly(), avgRetrieveOnly, printAll);
    printDatabasePerfElement(RETRIEVE_MD_LABEL, stats.getRetrieveMd(), avgRetrieveMd, printAll);
    printDatabasePerfElement(DELETE_LABEL, stats.getDelete(), avgDelete, printAll);
    if (printAll) {
      printDatabasePerfElement(SCHEMA_LABEL, stats.getSchema(), avgSchema, printAll);
    }
    printDatabasePerfElement(QUERY_LABEL, stats.getQuery(), avgQuery, printAll);
    printDatabasePerfElement(WEBDAV_PUT_LABEL, stats.getWebdavPut(), avgWebdavPut, printAll);
    printDatabasePerfElement(WEBDAV_GET_LABEL, stats.getWebdavGet(), avgWebdavGet, printAll);
  }