提交 1fee5164 编写于 作者: H Hui Li

temporary branch for TD-1712

上级 51ab8a58
...@@ -543,13 +543,6 @@ int main(int argc, char *argv[]) { ...@@ -543,13 +543,6 @@ int main(int argc, char *argv[]) {
"./output.txt", // output_file "./output.txt", // output_file
0, // mode 0, // mode
{ {
"int", // datatype
"int",
"int",
"int",
"int",
"int",
"int",
"float" "float"
}, },
8, // len_of_binary 8, // len_of_binary
...@@ -569,7 +562,7 @@ int main(int argc, char *argv[]) { ...@@ -569,7 +562,7 @@ int main(int argc, char *argv[]) {
reflected in arguments. */ reflected in arguments. */
// For demo use, change default values for some parameters; // For demo use, change default values for some parameters;
arguments.num_of_tables = 10000; arguments.num_of_tables = 10000;
arguments.num_of_CPR = 3; arguments.num_of_CPR = 1;
arguments.num_of_threads = 10; arguments.num_of_threads = 10;
arguments.num_of_DPT = 100000; arguments.num_of_DPT = 100000;
arguments.num_of_RPR = 1000; arguments.num_of_RPR = 1000;
...@@ -724,7 +717,7 @@ int main(int argc, char *argv[]) { ...@@ -724,7 +717,7 @@ int main(int argc, char *argv[]) {
if (use_metric) { if (use_metric) {
/* Create metric table */ /* Create metric table */
printf("Creating meters super table...\n"); printf("Creating meters super table...\n");
snprintf(command, BUFFER_SIZE, "create table if not exists %s.meters (ts timestamp%s) tags (areaid int, loc binary(10))", db_name, cols); snprintf(command, BUFFER_SIZE, "create table if not exists %s.meters (ts timestamp%s) tags (uuid binary(50))", db_name, cols);
queryDB(taos, command); queryDB(taos, command);
printf("meters created!\n"); printf("meters created!\n");
} }
...@@ -879,6 +872,10 @@ int main(int argc, char *argv[]) { ...@@ -879,6 +872,10 @@ int main(int argc, char *argv[]) {
taos_close(rInfo->taos); taos_close(rInfo->taos);
} }
printf("###################################################################\n\n");
printf("Press enter key to EXIT");
(void)getchar();
return 0; return 0;
} }
...@@ -1002,17 +999,9 @@ void * createTable(void *sarg) ...@@ -1002,17 +999,9 @@ void * createTable(void *sarg)
/* Create all the tables; */ /* Create all the tables; */
printf("Creating table from %d to %d\n", winfo->start_table_id, winfo->end_table_id); printf("Creating table from %d to %d\n", winfo->start_table_id, winfo->end_table_id);
for (int i = winfo->start_table_id; i <= winfo->end_table_id; i++) { for (int i = winfo->start_table_id; i <= winfo->end_table_id; i++) {
int j; float a = 5.0;
if (i % 10 == 0) { float x = (float)rand()/(float)(RAND_MAX * a);
j = 10; snprintf(command, BUFFER_SIZE, "INSERT INTO %s.%s%050d using %s.meters tags (\"%050d\") VALUES(now, %f);", winfo->db_name, winfo->tb_prefix, i, winfo->db_name, i, x);
} else {
j = i % 10;
}
if (j % 2 == 0) {
snprintf(command, BUFFER_SIZE, "create table if not exists %s.%s%d using %s.meters tags (%d,\"%s\");", winfo->db_name, winfo->tb_prefix, i, winfo->db_name, j, "shanghai");
} else {
snprintf(command, BUFFER_SIZE, "create table if not exists %s.%s%d using %s.meters tags (%d,\"%s\");", winfo->db_name, winfo->tb_prefix, i, winfo->db_name, j, "beijing");
}
queryDB(winfo->taos, command); queryDB(winfo->taos, command);
} }
} }
...@@ -1245,7 +1234,7 @@ void *syncWrite(void *sarg) { ...@@ -1245,7 +1234,7 @@ void *syncWrite(void *sarg) {
int64_t tmp_time = time_counter; int64_t tmp_time = time_counter;
char *pstr = buffer; char *pstr = buffer;
pstr += sprintf(pstr, "insert into %s.%s%d values", winfo->db_name, winfo->tb_prefix, tID); pstr += sprintf(pstr, "insert into %s.%s%050d values", winfo->db_name, winfo->tb_prefix, tID);
int k; int k;
for (k = 0; k < winfo->nrecords_per_request;) { for (k = 0; k < winfo->nrecords_per_request;) {
int rand_num = rand() % 100; int rand_num = rand() % 100;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册