~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/drizzleslap.cc

Slap refactored with boost::program_options. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
135
135
  pre_system,
136
136
  post_system;
137
137
 
 
138
static vector<string> user_supplied_queries;
 
139
 
138
140
string delimiter;
139
141
 
140
142
string create_schema_string;
826
828
  return s + us;
827
829
}
828
830
 
 
831
static void combine_queries(vector<string> queries)
 
832
{
 
833
  user_supplied_query.erase();
 
834
  for (vector<string>::iterator it= queries.begin();
 
835
       it != queries.end();
 
836
       ++it)
 
837
  {
 
838
    user_supplied_query.append(*it);
 
839
    user_supplied_query.append(delimiter);
 
840
  }
 
841
}
 
842
 
829
843
int main(int argc, char **argv)
830
844
{
831
845
  char *password= NULL;
887
901
  "Detach (close and re open) connections after X number of requests")
888
902
  ("engine ,e",po::value<string>(&default_engine)->default_value(""),
889
903
  "Storage engien to use for creating the table")
890
 
  ("host,h",po::value<string>(&host)->default_value(""),"Connect to the host")
 
904
  ("host,h",po::value<string>(&host)->default_value("localhost"),"Connect to the host")
891
905
  ("iterations,i",po::value<uint32_t>(&iterations)->default_value(1),
892
906
  "Number of times to run the tests")
893
907
  ("label",po::value<string>(&opt_label)->default_value(""),
920
934
  "system() string to execute before running tests.")
921
935
  ("protocol",po::value<string>(),
922
936
  "The protocol of connection (tcp,socket,pipe,memory).")
923
 
  ("query,q",po::value<string>(&user_supplied_query)->default_value(""),
 
937
  ("query,q",po::value<vector<string> >(&user_supplied_queries)->composing()->notifier(&combine_queries),
924
938
  "Query to run or file containing query")
925
939
  ("set-random-seed",
926
940
  po::value<uint32_t>(&opt_set_random_seed)->default_value(0), 
1041
1055
  /* globals? Yes, so we only have to run strlen once */
1042
1056
  delimiter_length= delimiter.length();
1043
1057
 
1044
 
  /*if (argc > 2)
1045
 
  {
1046
 
    fprintf(stderr,"%s: Too many arguments\n",internal::my_progname);
1047
 
    internal::free_defaults(defaults_argv);
1048
 
    internal::my_end();
1049
 
    exit(1);
1050
 
  }*/
1051
 
 
1052
1058
  slap_connect(&con, false);
1053
1059
 
1054
1060
  pthread_mutex_init(&counter_mutex, NULL);