Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: taosbenchmark code refactor #599

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
a1cbfab
fix: refactor line protocol data generation
sangshuduo Feb 16, 2023
cccc353
test: change test branch
sangshuduo Feb 16, 2023
10a211f
test: add brew install pkg-config in macos workflows
sangshuduo Feb 17, 2023
cc6db40
fix: check snprintf return
sangshuduo Feb 17, 2023
a8d419c
Merge branch 'develop' into fix/sangshuduo/TD-21932-taosbenchmark-dat…
sangshuduo Feb 17, 2023
e0104dc
fix: taosbenchmark insert refactor
sangshuduo Feb 17, 2023
bc11ff3
fix: reduce complexity of sml data generating
sangshuduo Feb 17, 2023
b23e170
test: don't build jdbc on windows
sangshuduo Feb 17, 2023
a62f774
fix: check unsigned int generated
sangshuduo Feb 17, 2023
aeb0003
fix: refactor cleanup and print
sangshuduo Feb 18, 2023
a880c81
fix: refect prepare sml data
sangshuduo Feb 18, 2023
62bcecb
Merge branch 'develop' into fix/sangshuduo/TD-21932-taosbenchmark-dat…
sangshuduo Feb 19, 2023
8b89398
fix: add sml_tags_json_array to accelerate sml json test
sangshuduo Feb 19, 2023
b3b4ed7
fix: taosbenchmark json data generating refine
sangshuduo Feb 19, 2023
ad2f7c8
fix: comma adding timing
sangshuduo Feb 20, 2023
645f962
fix: coverity scan issues
sangshuduo Feb 20, 2023
d259385
fix: use strncat instead of snprintf
sangshuduo Feb 20, 2023
be929ab
fix: adjust end time position
sangshuduo Feb 20, 2023
63e63d6
fix: avoid random data generation
sangshuduo Feb 20, 2023
2a38de1
fix: remove unused func
sangshuduo Feb 20, 2023
0d4c001
fix: remove refactor macro
sangshuduo Feb 20, 2023
9eebdef
Merge branch 'develop' into fix/sangshuduo/TD-21932-taosbenchmark-dat…
sangshuduo Feb 20, 2023
38422c6
Merge branch 'develop' into fix/sangshuduo/TD-21932-taosbenchmark-dat…
sangshuduo Feb 21, 2023
94489f5
test: add taosbenchmark/csv/insert-json-csv.py
sangshuduo Feb 21, 2023
82b96df
fix: csv read pos/len bug
sangshuduo Feb 21, 2023
6f692b0
fix: support tdengine v2
sangshuduo Feb 21, 2023
b59c7dd
fix: merge with develop
sangshuduo Mar 4, 2023
85e55a7
fix: don't repeat
sangshuduo Mar 4, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 11 additions & 16 deletions src/benchData.c
Original file line number Diff line number Diff line change
Expand Up @@ -1461,8 +1461,15 @@ int generateRandData(SSuperTable *stbInfo, char *sampleDataBuf,
return -1;
}

int prepareChildTblSampleData(SDataBase* database, SSuperTable* stbInfo) {
return -1;
static BArray *initChildCols(int colsSize) {
BArray *childCols = benchArrayInit(colsSize,
sizeof(ChildField));
for (int col = 0; col < colsSize; col++) {
ChildField *childCol = benchCalloc(
1, sizeof(ChildField), true);
benchArrayPush(childCols, childCol);
}
return childCols;
}

int prepareSampleData(SDataBase* database, SSuperTable* stbInfo) {
Expand Down Expand Up @@ -1523,13 +1530,7 @@ int prepareSampleData(SDataBase* database, SSuperTable* stbInfo) {
for (int64_t child = 0; child < stbInfo->childTblCount; child++) {
SChildTable *childTbl = stbInfo->childTblArray[child];
if (STMT_IFACE == stbInfo->iface) {
childTbl->childCols = benchArrayInit(stbInfo->cols->size,
sizeof(ChildField));
for (int col = 0; col < stbInfo->cols->size; col++) {
ChildField *childCol = benchCalloc(
1, sizeof(ChildField), true);
benchArrayPush(childTbl->childCols, childCol);
}
childTbl->childCols = initChildCols(stbInfo->cols->size);
}
childTbl->sampleDataBuf =
benchCalloc(
Expand Down Expand Up @@ -1609,13 +1610,7 @@ int prepareSampleData(SDataBase* database, SSuperTable* stbInfo) {
return -1;
}
if (STMT_IFACE == stbInfo->iface) {
childTbl->childCols = benchArrayInit(stbInfo->cols->size,
sizeof(ChildField));
for (int col = 0; col < stbInfo->cols->size; col++) {
ChildField *childCol = benchCalloc(
1, sizeof(ChildField), true);
benchArrayPush(childTbl->childCols, childCol);
}
childTbl->childCols = initChildCols(stbInfo->cols->size);
}
childTbl->useOwnSample = true;
debugPrint("sampleDataBuf: %s\n", childTbl->sampleDataBuf);
Expand Down
23 changes: 8 additions & 15 deletions src/benchInsert.c
Original file line number Diff line number Diff line change
Expand Up @@ -1813,9 +1813,7 @@ static int32_t prepareProgressDataSmlJson(
}

static int32_t prepareProgressDataSmlLine(
threadInfo *pThreadInfo,
uint64_t tableSeq,
char *sampleDataBuf,
threadInfo *pThreadInfo, uint64_t tableSeq, char *sampleDataBuf,
int64_t *timestamp, uint64_t i, char *ttl) {
// prepareProgressDataSmlLine
SSuperTable *stbInfo = pThreadInfo->stbInfo;
Expand All @@ -1828,11 +1826,9 @@ static int32_t prepareProgressDataSmlLine(
pThreadInfo->lines[j],
stbInfo->lenOfCols + stbInfo->lenOfTags,
"%s %s %" PRId64 "",
pThreadInfo
->sml_tags[(int)tableSeq -
pThreadInfo->start_table_from],
sampleDataBuf +
pos * stbInfo->lenOfCols,
pThreadInfo->sml_tags[tableSeq
- pThreadInfo->start_table_from],
sampleDataBuf + pos * stbInfo->lenOfCols,
*timestamp);
pos++;
if (pos >= g_arguments->prepared_rand) {
Expand All @@ -1851,9 +1847,7 @@ static int32_t prepareProgressDataSmlLine(
}

static int32_t prepareProgressDataSmlTelnet(
threadInfo *pThreadInfo,
uint64_t tableSeq,
char *sampleDataBuf,
threadInfo *pThreadInfo, uint64_t tableSeq, char *sampleDataBuf,
int64_t *timestamp, uint64_t i, char *ttl) {
// prepareProgressDataSmlTelnet
SSuperTable *stbInfo = pThreadInfo->stbInfo;
Expand All @@ -1868,10 +1862,9 @@ static int32_t prepareProgressDataSmlTelnet(
"%s %" PRId64 " %s %s", stbInfo->stbName,
*timestamp,
sampleDataBuf
+ pos * stbInfo->lenOfCols,
pThreadInfo
->sml_tags[(int)tableSeq
-pThreadInfo->start_table_from]);
+ pos * stbInfo->lenOfCols,
pThreadInfo->sml_tags[tableSeq
-pThreadInfo->start_table_from]);
pos++;
if (pos >= g_arguments->prepared_rand) {
pos = 0;
Expand Down