コード例 #1
0
 private void printDatabasePerfElement(
     String elementName, HCPerfElement element, AvgMetric avg, boolean printAll) {
   if (printAll) {
     String kbSec = element.getKbSec();
     String runKBSec = null;
     if (kbSec != null) runKBSec = Double.toString(avg.getRunAvgKBTransferred());
     System.out.println(
         allStatsFormatter.sprintf(
             new String[] {
               new StringBuffer(elementName).append(":").toString(),
               getDoubleValue(element.getOpSec()),
               PrecisionFormatter.formatValue(avg.getAvgResponseTime(), 2),
               getDoubleValue(kbSec),
               PrecisionFormatter.formatValue(avg.getRunAvgOpPerSec(), 2),
               PrecisionFormatter.formatValue(avg.getRunAvgResponseTime(), 2),
               getDoubleValue(runKBSec)
             }));
   } else {
     System.out.println(
         statsFormatter.sprintf(
             new String[] {
               new StringBuffer(elementName).append(":").toString(),
               getLongValue(element.getOps()),
               getDoubleValue(element.getOpSec()),
               getDoubleValue(element.getKbSec()),
             }));
   }
 }
コード例 #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);
  }