Note: The table schema is based on the blog [(In Chinese) Data Transfer, Storage, Presentation, EMQX + TDengine Build MQTT IoT Data Visualization Platform](https://www.taosdata.com/blog/2020/08/04/1722.html) as an example. Subsequent operations are carried out with this blog scenario too. Please modify it according to your actual application scenario.
...
...
@@ -81,84 +81,84 @@ Edit the resource configuration to add the key/value pairing for Authorization.
## Compose program to mock data
```javascript
// mock.js
constmqtt=require('mqtt')
constMock=require('mockjs')
constEMQX_SERVER='mqtt://localhost:1883'
constCLIENT_NUM=10
constSTEP=5000// Data interval in ms
constAWAIT=5000// Sleep time after data be written once to avoid data writing too fast
Note: `CLIENT_NUM` in the code can be set to a smaller value at the beginning of the test to avoid hardware performance be not capable to handle a more significant number of concurrent clients.