docs: optimize document description
This commit is contained in:
parent
1c2072eb80
commit
8292b8df25
|
@ -298,11 +298,11 @@ Parameters related to supertable creation are configured in the `super_tables` s
|
||||||
|
|
||||||
- **csv_ts_interval**: String type, sets the time interval for splitting generated csv file names. Supports daily, hourly, minute, and second intervals such as 1d/2h/30m/40s. The default value is "1d".
|
- **csv_ts_interval**: String type, sets the time interval for splitting generated csv file names. Supports daily, hourly, minute, and second intervals such as 1d/2h/30m/40s. The default value is "1d".
|
||||||
|
|
||||||
- **csv_output_header**: String type, sets whether the generated csv files should contain column header descriptions. The default value is "true".
|
- **csv_output_header**: String type, sets whether the generated csv files should contain column header descriptions. The default value is "yes".
|
||||||
|
|
||||||
- **csv_tbname_alias**: String type, sets the alias for the tbname field in the column header descriptions of csv files. The default value is "device_id".
|
- **csv_tbname_alias**: String type, sets the alias for the tbname field in the column header descriptions of csv files. The default value is "device_id".
|
||||||
|
|
||||||
- **csv_compress_level**: String type, sets the compression level when generating csv files and automatically compressing them into gzip format. Possible values are:
|
- **csv_compress_level**: String type, sets the compression level for generating csv-encoded data and automatically compressing it into gzip file. This process directly encodes and compresses the data, rather than first generating a csv file and then compressing it. Possible values are:
|
||||||
- none: No compression
|
- none: No compression
|
||||||
- fast: gzip level 1 compression
|
- fast: gzip level 1 compression
|
||||||
- balance: gzip level 6 compression
|
- balance: gzip level 6 compression
|
||||||
|
@ -502,6 +502,17 @@ Note: Data types in the taosBenchmark configuration file must be in lowercase to
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
### Export CSV File Example
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>csv-export.json</summary>
|
||||||
|
|
||||||
|
```json
|
||||||
|
{{#include /TDengine/tools/taos-tools/example/csv-export.json}}
|
||||||
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
Other json examples see [here](https://github.com/taosdata/TDengine/tree/main/tools/taos-tools/example)
|
Other json examples see [here](https://github.com/taosdata/TDengine/tree/main/tools/taos-tools/example)
|
||||||
|
|
||||||
## Output Performance Indicators
|
## Output Performance Indicators
|
||||||
|
|
|
@ -93,7 +93,7 @@ taosBenchmark -f <json file>
|
||||||
|
|
||||||
本节所列参数适用于所有功能模式。
|
本节所列参数适用于所有功能模式。
|
||||||
|
|
||||||
- **filetype**:功能分类,可选值为 `insert`、`query`、`subscribe` 和 `csvfile`。分别对应插入、查询、订阅和生成csv文件功能。每个配置文件中只能指定其中之一。
|
- **filetype**:功能分类,可选值为 `insert`、`query`、`subscribe` 和 `csvfile`。分别对应插入、查询、订阅和生成 csv 文件功能。每个配置文件中只能指定其中之一。
|
||||||
|
|
||||||
- **cfgdir**:TDengine 客户端配置文件所在的目录,默认路径是 /etc/taos 。
|
- **cfgdir**:TDengine 客户端配置文件所在的目录,默认路径是 /etc/taos 。
|
||||||
|
|
||||||
|
@ -206,11 +206,11 @@ taosBenchmark -f <json file>
|
||||||
|
|
||||||
- **csv_ts_interval**:字符串类型,设置生成的 csv 文件名称中时间段间隔,支持天、小时、分钟、秒级间隔,如 1d/2h/30m/40s,默认值为 1d 。
|
- **csv_ts_interval**:字符串类型,设置生成的 csv 文件名称中时间段间隔,支持天、小时、分钟、秒级间隔,如 1d/2h/30m/40s,默认值为 1d 。
|
||||||
|
|
||||||
- **csv_output_header**:字符串类型,设置生成的 csv 文件是否包含列头描述,默认值为 true 。
|
- **csv_output_header**:字符串类型,设置生成的 csv 文件是否包含列头描述,默认值为 yes 。
|
||||||
|
|
||||||
- **csv_tbname_alias**:字符串类型,设置 csv 文件列头描述中 tbname 字段的别名,默认值为 device_id 。
|
- **csv_tbname_alias**:字符串类型,设置 csv 文件列头描述中 tbname 字段的别名,默认值为 device_id 。
|
||||||
|
|
||||||
- **csv_compress_level**:字符串类型,设置生成 csv 并自动压缩成 gzip 格式文件的压缩等级。可选值为:
|
- **csv_compress_level**:字符串类型,设置生成 csv 编码数据并自动压缩成 gzip 格式文件的压缩等级。此过程直接编码并压缩,而非先生成 csv 文件再压缩。可选值为:
|
||||||
- none:不压缩
|
- none:不压缩
|
||||||
- fast:gzip 1级压缩
|
- fast:gzip 1级压缩
|
||||||
- balance:gzip 6级压缩
|
- balance:gzip 6级压缩
|
||||||
|
@ -410,6 +410,17 @@ interval 控制休眠时间,避免持续查询慢查询消耗 CPU,单位为
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
### 生成 CSV 文件 JSON 示例
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>csv-export.json</summary>
|
||||||
|
|
||||||
|
```json
|
||||||
|
{{#include /TDengine/tools/taos-tools/example/csv-export.json}}
|
||||||
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
查看更多 json 配置文件示例可 [点击这里](https://github.com/taosdata/TDengine/tree/main/tools/taos-tools/example)
|
查看更多 json 配置文件示例可 [点击这里](https://github.com/taosdata/TDengine/tree/main/tools/taos-tools/example)
|
||||||
|
|
||||||
## 输出性能指标
|
## 输出性能指标
|
||||||
|
|
|
@ -16,6 +16,7 @@ import csv
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
import frame
|
import frame
|
||||||
|
import frame.eos
|
||||||
import frame.etool
|
import frame.etool
|
||||||
from frame.log import *
|
from frame.log import *
|
||||||
from frame.cases import *
|
from frame.cases import *
|
||||||
|
@ -213,7 +214,7 @@ class TDTestCase(TBase):
|
||||||
|
|
||||||
# exec
|
# exec
|
||||||
cmd = f"{benchmark} {options} -f {jsonFile}"
|
cmd = f"{benchmark} {options} -f {jsonFile}"
|
||||||
os.system(cmd)
|
eos.exe(cmd)
|
||||||
|
|
||||||
# check result
|
# check result
|
||||||
self.check_result(jsonFile)
|
self.check_result(jsonFile)
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
"childtable_from": 1000,
|
"childtable_from": 1000,
|
||||||
"childtable_to": 1010,
|
"childtable_to": 1010,
|
||||||
"csv_file_prefix": "data",
|
"csv_file_prefix": "data",
|
||||||
"csv_output_header": "true",
|
"csv_output_header": "yes",
|
||||||
"csv_tbname_alias": "device_id",
|
"csv_tbname_alias": "device_id",
|
||||||
"csv_compress_level": "none",
|
"csv_compress_level": "none",
|
||||||
"columns": [
|
"columns": [
|
||||||
|
@ -59,7 +59,7 @@
|
||||||
"csv_file_prefix": "data",
|
"csv_file_prefix": "data",
|
||||||
"csv_ts_format": "%Y%m%d",
|
"csv_ts_format": "%Y%m%d",
|
||||||
"csv_ts_interval": "1d",
|
"csv_ts_interval": "1d",
|
||||||
"csv_output_header": "true",
|
"csv_output_header": "yes",
|
||||||
"csv_tbname_alias": "device_id",
|
"csv_tbname_alias": "device_id",
|
||||||
"csv_compress_level": "none",
|
"csv_compress_level": "none",
|
||||||
"columns": [
|
"columns": [
|
||||||
|
@ -98,7 +98,7 @@
|
||||||
"childtable_from": 1000,
|
"childtable_from": 1000,
|
||||||
"childtable_to": 1010,
|
"childtable_to": 1010,
|
||||||
"csv_file_prefix": "data",
|
"csv_file_prefix": "data",
|
||||||
"csv_output_header": "true",
|
"csv_output_header": "yes",
|
||||||
"csv_tbname_alias": "device_id",
|
"csv_tbname_alias": "device_id",
|
||||||
"csv_compress_level": "none",
|
"csv_compress_level": "none",
|
||||||
"columns": [
|
"columns": [
|
||||||
|
@ -139,7 +139,7 @@
|
||||||
"csv_file_prefix": "data",
|
"csv_file_prefix": "data",
|
||||||
"csv_ts_format": "%Y%m%d",
|
"csv_ts_format": "%Y%m%d",
|
||||||
"csv_ts_interval": "1d",
|
"csv_ts_interval": "1d",
|
||||||
"csv_output_header": "true",
|
"csv_output_header": "yes",
|
||||||
"csv_tbname_alias": "device_id",
|
"csv_tbname_alias": "device_id",
|
||||||
"csv_compress_level": "none",
|
"csv_compress_level": "none",
|
||||||
"columns": [
|
"columns": [
|
||||||
|
|
|
@ -0,0 +1,54 @@
|
||||||
|
{
|
||||||
|
"filetype": "csvfile",
|
||||||
|
"output_path": "./csv/",
|
||||||
|
"databases": [
|
||||||
|
{
|
||||||
|
"dbinfo": {
|
||||||
|
"name": "csvdb",
|
||||||
|
"precision": "ms"
|
||||||
|
},
|
||||||
|
"super_tables": [
|
||||||
|
{
|
||||||
|
"name": "table",
|
||||||
|
"childtable_count": 1010,
|
||||||
|
"insert_rows": 1000,
|
||||||
|
"interlace_rows": 1,
|
||||||
|
"childtable_prefix": "d",
|
||||||
|
"timestamp_step": 1000000,
|
||||||
|
"start_timestamp": "2020-10-01 00:00:00.000",
|
||||||
|
"childtable_from": 1000,
|
||||||
|
"childtable_to": 1010,
|
||||||
|
"csv_file_prefix": "data",
|
||||||
|
"csv_ts_format": "%Y%m%d",
|
||||||
|
"csv_ts_interval": "1d",
|
||||||
|
"csv_output_header": "true",
|
||||||
|
"csv_tbname_alias": "device_id",
|
||||||
|
"csv_compress_level": "none",
|
||||||
|
"columns": [
|
||||||
|
{ "type": "bool", "name": "bc"},
|
||||||
|
{ "type": "float", "name": "fc", "min": 1},
|
||||||
|
{ "type": "double", "name": "dc", "min":10, "max":10},
|
||||||
|
{ "type": "tinyint", "name": "ti"},
|
||||||
|
{ "type": "smallint", "name": "si"},
|
||||||
|
{ "type": "int", "name": "ic", "fillNull":"false"},
|
||||||
|
{ "type": "bigint", "name": "bi"},
|
||||||
|
{ "type": "utinyint", "name": "uti"},
|
||||||
|
{ "type": "usmallint", "name": "usi", "min":100, "max":120},
|
||||||
|
{ "type": "uint", "name": "ui"},
|
||||||
|
{ "type": "ubigint", "name": "ubi"},
|
||||||
|
{ "type": "binary", "name": "bin", "len": 16},
|
||||||
|
{ "type": "nchar", "name": "nch", "len": 16}
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
{"type": "tinyint", "name": "groupid","max": 10,"min": 1},
|
||||||
|
{"type": "binary", "name": "location", "len": 16,
|
||||||
|
"values": ["San Francisco", "Los Angles", "San Diego",
|
||||||
|
"San Jose", "Palo Alto", "Campbell", "Mountain View",
|
||||||
|
"Sunnyvale", "Santa Clara", "Cupertino"]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
|
@ -1434,9 +1434,9 @@ static int getStableInfo(tools_cJSON *dbinfos, int index) {
|
||||||
superTable->csv_output_header = true;
|
superTable->csv_output_header = true;
|
||||||
tools_cJSON* oph = tools_cJSON_GetObjectItem(stbInfo, "csv_output_header");
|
tools_cJSON* oph = tools_cJSON_GetObjectItem(stbInfo, "csv_output_header");
|
||||||
if (oph && oph->type == tools_cJSON_String && oph->valuestring != NULL) {
|
if (oph && oph->type == tools_cJSON_String && oph->valuestring != NULL) {
|
||||||
if (0 == strcasecmp(oph->valuestring, "yes") || 0 == strcasecmp(oph->valuestring, "true")) {
|
if (0 == strcasecmp(oph->valuestring, "yes")) {
|
||||||
superTable->csv_output_header = true;
|
superTable->csv_output_header = true;
|
||||||
} else if (0 == strcasecmp(oph->valuestring, "no") || 0 == strcasecmp(oph->valuestring, "false")) {
|
} else if (0 == strcasecmp(oph->valuestring, "no")) {
|
||||||
superTable->csv_output_header = false;
|
superTable->csv_output_header = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue