提交 ca9c0ad2 编写于 作者: B Bomin Zhang

TD-1033: enable telemetry reporting by default

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