• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

taosdata / TDengine / #4829

30 Oct 2025 09:25AM UTC coverage: 49.734% (-11.3%) from 61.071%
#4829

push

travis-ci

web-flow
Merge pull request #33435 from taosdata/3.0

merge 3.0

123072 of 323930 branches covered (37.99%)

Branch coverage included in aggregate %.

7 of 25 new or added lines in 3 files covered. (28.0%)

35232 existing lines in 327 files now uncovered.

172062 of 269495 relevant lines covered (63.85%)

70709785.06 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

40.0
/source/dnode/mgmt/node_util/src/dmUtil.c
1
/*
2
 * Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
3
 *
4
 * This program is free software: you can use, redistribute, and/or modify
5
 * it under the terms of the GNU Affero General Public License, version 3
6
 * or later ("AGPL"), as published by the Free Software Foundation.
7
 *
8
 * This program is distributed in the hope that it will be useful, but WITHOUT
9
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10
 * FITNESS FOR A PARTICULAR PURPOSE.
11
 *
12
 * You should have received a copy of the GNU Affero General Public License
13
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
14
 */
15

16
#define _DEFAULT_SOURCE
17
#include "dmUtil.h"
18

19
const char *dmStatStr(EDndRunStatus stype) {
6,566✔
20
  switch (stype) {
6,566!
21
    case DND_STAT_INIT:
1,491✔
22
      return "init";
1,491✔
23
    case DND_STAT_RUNNING:
3,283✔
24
      return "running";
3,283✔
25
    case DND_STAT_STOPPED:
1,792✔
26
      return "stopped";
1,792✔
27
    default:
×
28
      return "UNKNOWN";
×
29
  }
30
}
31

32
const char *dmNodeName(EDndNodeType ntype) {
846,756✔
33
  switch (ntype) {
846,756✔
34
    case VNODE:
141,126✔
35
      return "vnode";
141,126✔
36
    case QNODE:
141,126✔
37
      return "qnode";
141,126✔
38
    case SNODE:
141,126✔
39
      return "snode";
141,126✔
40
    case BNODE:
141,126✔
41
      return "bnode";
141,126✔
42
    case MNODE:
141,126✔
43
      return "mnode";
141,126✔
44
    default:
141,126✔
45
      return "dnode";
141,126✔
46
  }
47
}
48

49
void *dmSetMgmtHandle(SArray *pArray, tmsg_t msgType, void *nodeMsgFp, bool needCheckVgId) {
47,268,165✔
50
  SMgmtHandle handle = {
47,268,165✔
51
      .msgType = msgType,
52
      .msgFp = (NodeMsgFp)nodeMsgFp,
47,268,165✔
53
      .needCheckVgId = needCheckVgId,
54
  };
55

56
  return taosArrayPush(pArray, &handle);
47,268,165✔
57
}
58

UNCOV
59
void dmGetMonitorSystemInfo(SMonSysInfo *pInfo) {
×
UNCOV
60
  int32_t code = 0;
×
UNCOV
61
  code = taosGetCpuUsage(&pInfo->cpu_system, &pInfo->cpu_engine);
×
UNCOV
62
  if (code != 0) {
×
63
    dError("failed to get cpu usage since %s", tstrerror(code));
×
64
  }
UNCOV
65
  code = taosGetCpuCores(&pInfo->cpu_cores, false);
×
UNCOV
66
  if (code != 0) {
×
67
    dError("failed to get cpu cores since %s", tstrerror(code));
×
68
  }
UNCOV
69
  code = taosGetProcMemory(&pInfo->mem_engine);
×
UNCOV
70
  if (code != 0) {
×
71
    dError("failed to get proc memory since %s", tstrerror(code));
×
72
  }
UNCOV
73
  code = taosGetSysMemory(&pInfo->mem_system, &pInfo->mem_free, &pInfo->mem_cacheBuffer);
×
UNCOV
74
  if (code != 0) {
×
75
    dError("failed to get sys memory since %s", tstrerror(code));
×
76
  }
UNCOV
77
  pInfo->mem_total = tsTotalMemoryKB;
×
UNCOV
78
  pInfo->disk_engine = 0;
×
UNCOV
79
  pInfo->disk_used = tsDataSpace.size.used;
×
UNCOV
80
  pInfo->disk_total = tsDataSpace.size.total;
×
UNCOV
81
  code = taosGetCardInfoDelta(&pInfo->net_in, &pInfo->net_out);
×
UNCOV
82
  if (code != 0) {
×
83
    dError("failed to get card info since %s", tstrerror(code));
×
84
    taosSetDefaultCardInfoDelta(&pInfo->net_in, &pInfo->net_out);
×
85
  }
UNCOV
86
  code = taosGetProcIODelta(&pInfo->io_read, &pInfo->io_write, &pInfo->io_read_disk, &pInfo->io_write_disk);
×
UNCOV
87
  if (code != 0) {
×
88
    dError("failed to get proc io delta since %s", tstrerror(code));
×
89
    taosSetDefaultProcIODelta(&pInfo->io_read, &pInfo->io_write, &pInfo->io_read_disk, &pInfo->io_write_disk);
×
90
  }
UNCOV
91
  return;
×
92
}
93

94
int32_t dmGetDnodeId(SDnodeData *pData) { return pData->dnodeId; }
14,845,387✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc