Exemplo n.º 1
0
long test_row_put_list(HbCli myhbcli, std::string table, int klen, int vlen, int lnum) {
  long ms = 0;
  char key[klen+1];
  char value[vlen+1];
  RowMap rowMap;
  for (int i=0; i<COUNT; i++) {
    rand_str(key, klen);
    rand_str(value, vlen);
    StrMap columnMap;
    columnMap.insert(std::pair<std::string, std::string>("entry:m1", value));
    rowMap.insert(std::pair<std::string, StrMap>(key, columnMap));
    if (rowMap.size() == lnum) {
      gettimeofday(&tvpre, NULL);
      myhbcli.putRows(table, rowMap);
      rowMap.clear();
      gettimeofday(&tvafter, NULL);
      ms += gen_ms(tvpre, tvafter);
    }
  }
  return ms;
}