未验证 提交 634d8968 编写于 作者: S Shengliang Guan 提交者: GitHub

Merge pull request #2886 from taosdata/feature/td-1033

TD-1033: enable telemetry reporting by default
......@@ -40,7 +40,7 @@ uint16_t tsSyncPort = 6040;
int32_t tsStatusInterval = 1; // second
int32_t tsNumOfMnodes = 3;
int32_t tsEnableVnodeBak = 1;
int32_t tsEnableTelemetryReporting = 0;
int32_t tsEnableTelemetryReporting = 1;
// common
int32_t tsRpcTimer = 1000;
......
......@@ -174,7 +174,6 @@ static void addVersionInfo(SBufferWriter* bw) {
}
static void addRuntimeInfo(SBufferWriter* bw) {
addStringField(bw, "clusterId", mnodeGetClusterId());
// addIntField(&bw, "numOfDnode", 1);
// addIntField(&bw, "numOfVnode", 1);
// addIntField(&bw, "numOfStable", 1);
......@@ -189,17 +188,18 @@ static void sendTelemetryReport() {
char buf[128];
uint32_t ip = taosGetIpFromFqdn(TELEMETRY_SERVER);
if (ip == 0xffffffff) {
dError("failed to get IP address of " TELEMETRY_SERVER ", reason:%s", strerror(errno));
dTrace("failed to get IP address of " TELEMETRY_SERVER ", reason:%s", strerror(errno));
return;
}
int fd = taosOpenTcpClientSocket(ip, TELEMETRY_PORT, 0);
if (fd < 0) {
dError("failed to create socket for telemetry, reason:%s", strerror(errno));
dTrace("failed to create socket for telemetry, reason:%s", strerror(errno));
return;
}
SBufferWriter bw = tbufInitWriter(NULL, false);
beginObject(&bw);
addStringField(&bw, "instanceId", mnodeGetClusterId());
addIntField(&bw, "reportVersion", 1);
addOsInfo(&bw);
addCpuInfo(&bw);
......@@ -254,7 +254,7 @@ int32_t dnodeInitTelemetry() {
if (sem_init(&tsExitSem, 0, 0) == -1) {
// just log the error, it is ok for telemetry to fail
dError("failed to create semaphore for telemetry, reason:%s", strerror(errno));
dTrace("failed to create semaphore for telemetry, reason:%s", strerror(errno));
return 0;
}
......@@ -265,7 +265,7 @@ int32_t dnodeInitTelemetry() {
int32_t code = pthread_create(&tsTelemetryThread, &attr, telemetryThread, NULL);
pthread_attr_destroy(&attr);
if (code != 0) {
dError("failed to create telemetry thread, reason:%s", strerror(errno));
dTrace("failed to create telemetry thread, reason:%s", strerror(errno));
}
return 0;
......
......@@ -651,7 +651,11 @@ bool taosGetSystemUid(char *uid) {
close(fd);
}
return len > 0;
if (len >= 36) {
uid[36] = 0;
return true;
}
return false;
}
#endif
\ No newline at end of file
......@@ -39,6 +39,7 @@ class TDSimClient:
"udebugFlag": "135",
"jnidebugFlag": "135",
"qdebugFlag": "135",
"telemetryReporting": "0",
}
def init(self, path):
self.__init__()
......
......@@ -147,6 +147,6 @@ echo "asyncLog 0" >> $TAOS_CFG
echo "numOfMnodes 1" >> $TAOS_CFG
echo "locale en_US.UTF-8" >> $TAOS_CFG
echo "fsync 0" >> $TAOS_CFG
echo "tsEnableTelemetryReporting 0" >> $TAOS_CFG
echo "telemetryReporting 0" >> $TAOS_CFG
echo " " >> $TAOS_CFG
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册