From 3cdae6c7e2d9b98c88e461d733fb649558d00efc Mon Sep 17 00:00:00 2001 From: Ganlin Zhao Date: Tue, 2 Nov 2021 14:25:30 +0800 Subject: [PATCH] [TD-6452]: taoskeeper add HTTP status codes --- src/plugins/monitor/src/monMain.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/plugins/monitor/src/monMain.c b/src/plugins/monitor/src/monMain.c index 32d1043df6..e659893ef3 100644 --- a/src/plugins/monitor/src/monMain.c +++ b/src/plugins/monitor/src/monMain.c @@ -1206,14 +1206,15 @@ static void monSaveGrantsInfo() { static void monSaveHttpReqInfo() { int64_t ts = taosGetTimestampUs(); char * sql = tsMonitor.sql; - int32_t pos = snprintf(sql, SQL_LENGTH, "insert into %s.dnode_%d values(%" PRId64, tsMonitorDbName, dnodeGetDnodeId(), ts); + int32_t pos = snprintf(sql, SQL_LENGTH, "insert into %s.restful_%d values(%" PRId64, tsMonitorDbName, dnodeGetDnodeId(), ts); SDnodeStatisInfo info = dnodeGetStatisInfo(); + pos += snprintf(sql + pos, SQL_LENGTH, ", %d", info.httpReqNum); for (int32_t i = 0; i < tListLen(monHttpStatusTable); ++i) { int32_t status = info.httpStatusCodeErrs[i]; - pos += snprintf(sql, SQL_LENGTH, ", %d", status); + pos += snprintf(sql + pos, SQL_LENGTH, ", %d", status); } - pos += snprintf(sql, SQL_LENGTH, ")"); + pos += snprintf(sql + pos, SQL_LENGTH, ")"); monError("sql:%s", sql); -- GitLab