提交 01d1782d 编写于 作者: Y yihaoDeng

rewrite async write

上级 d1c91317
...@@ -790,14 +790,14 @@ int main(int argc, char *argv[]) { ...@@ -790,14 +790,14 @@ int main(int argc, char *argv[]) {
printf("ASYNC Insert with %d connections:\n", threads); printf("ASYNC Insert with %d connections:\n", threads);
} }
fprintf(fp, "|%10.d | %10.2f | %10.2f | %10.4f |\n\n", fprintf(fp, "|%"PRIu64" | %10.2f | %10.2f | %10.4f |\n\n",
ntables * nrecords_per_table, ntables * nrecords_per_table / t, (int64_t)ntables * nrecords_per_table, ntables * nrecords_per_table / t,
(ntables * nrecords_per_table) / (t * nrecords_per_request), ((int64_t)ntables * nrecords_per_table) / (t * nrecords_per_request),
t * 1000); t * 1000);
printf("Spent %.4f seconds to insert %d records with %d record(s) per request: %.2f records/second\n", printf("Spent %.4f seconds to insert %"PRIu64" records with %d record(s) per request: %.2f records/second\n",
t, ntables * nrecords_per_table, nrecords_per_request, t, (int64_t)ntables * nrecords_per_table, nrecords_per_request,
ntables * nrecords_per_table / t); (int64_t)ntables * nrecords_per_table / t);
for (int i = 0; i < threads; i++) { for (int i = 0; i < threads; i++) {
info *t_info = infos + i; info *t_info = infos + i;
...@@ -957,7 +957,7 @@ void querySqlFile(TAOS* taos, char* sqlFile) ...@@ -957,7 +957,7 @@ void querySqlFile(TAOS* taos, char* sqlFile)
double t = getCurrentTime(); double t = getCurrentTime();
while ((read_len = taosGetline(&line, &line_len, fp)) != -1) { while ((read_len = tgetline(&line, &line_len, fp)) != -1) {
if (read_len >= MAX_SQL_SIZE) continue; if (read_len >= MAX_SQL_SIZE) continue;
line[--read_len] = '\0'; line[--read_len] = '\0';
...@@ -1309,6 +1309,8 @@ void callBack(void *param, TAOS_RES *res, int code) { ...@@ -1309,6 +1309,8 @@ void callBack(void *param, TAOS_RES *res, int code) {
} }
if (winfo->start_table_id > winfo->end_table_id) { if (winfo->start_table_id > winfo->end_table_id) {
tsem_post(&winfo->lock_sem); tsem_post(&winfo->lock_sem);
free(buffer);
free(data);
taos_free_result(res); taos_free_result(res);
return; return;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册