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

taosdata / TDengine / #4912

04 Jan 2026 09:05AM UTC coverage: 64.888% (-0.1%) from 65.028%
#4912

push

travis-ci

web-flow
merge: from main to 3.0 branch #34156

1206 of 4524 new or added lines in 22 files covered. (26.66%)

5351 existing lines in 123 files now uncovered.

194856 of 300296 relevant lines covered (64.89%)

118198896.2 hits per line

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

82.76
/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) {
71,964✔
20
  switch (stype) {
71,964✔
21
    case DND_STAT_INIT:
17,129✔
22
      return "init";
17,129✔
23
    case DND_STAT_RUNNING:
35,982✔
24
      return "running";
35,982✔
25
    case DND_STAT_STOPPED:
18,853✔
26
      return "stopped";
18,853✔
27
    default:
×
28
      return "UNKNOWN";
×
29
  }
30
}
31

32
const char *dmNodeName(EDndNodeType ntype) {
3,810,613✔
33
  switch (ntype) {
3,810,613✔
34
    case VNODE:
545,204✔
35
      return "vnode";
545,204✔
36
    case QNODE:
543,861✔
37
      return "qnode";
543,861✔
38
    case SNODE:
543,861✔
39
      return "snode";
543,861✔
40
    case BNODE:
543,861✔
41
      return "bnode";
543,861✔
42
    case MNODE:
544,198✔
43
      return "mnode";
544,198✔
44
    case XNODE:
543,861✔
45
      return "xnode";
543,861✔
46
    default:
545,767✔
47
      return "dnode";
545,767✔
48
  }
49
}
50

51
void *dmSetMgmtHandle(SArray *pArray, tmsg_t msgType, void *nodeMsgFp, bool needCheckVgId) {
200,101,968✔
52
  SMgmtHandle handle = {
200,101,968✔
53
      .msgType = msgType,
54
      .msgFp = (NodeMsgFp)nodeMsgFp,
200,101,968✔
55
      .needCheckVgId = needCheckVgId,
56
  };
57

58
  return taosArrayPush(pArray, &handle);
200,101,968✔
59
}
60

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

96
int32_t dmGetDnodeId(SDnodeData *pData) { return pData->dnodeId; }
72,001,729✔
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