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

taosdata / TDengine / #4800

16 Oct 2025 09:19AM UTC coverage: 53.935% (-7.1%) from 61.083%
#4800

push

travis-ci

web-flow
Merge b32e3a393 into a190048d5

134724 of 323629 branches covered (41.63%)

Branch coverage included in aggregate %.

184803 of 268802 relevant lines covered (68.75%)

69058627.2 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) {
11,836✔
20
  switch (stype) {
11,836!
21
    case DND_STAT_INIT:
2,732✔
22
      return "init";
2,732✔
23
    case DND_STAT_RUNNING:
5,918✔
24
      return "running";
5,918✔
25
    case DND_STAT_STOPPED:
3,186✔
26
      return "stopped";
3,186✔
27
    default:
×
28
      return "UNKNOWN";
×
29
  }
30
}
31

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

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

56
  return taosArrayPush(pArray, &handle);
79,352,790✔
57
}
58

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

94
int32_t dmGetDnodeId(SDnodeData *pData) { return pData->dnodeId; }
22,646,460✔
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