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

taosdata / TDengine / #4513

17 Jul 2025 02:02AM UTC coverage: 31.359% (-31.1%) from 62.446%
#4513

push

travis-ci

web-flow
Merge pull request #31914 from taosdata/fix/3.0/compare-ans-failed

fix:Convert line endings from LF to CRLF for ans file

68541 of 301034 branches covered (22.77%)

Branch coverage included in aggregate %.

117356 of 291771 relevant lines covered (40.22%)

602262.98 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) {
60✔
20
  switch (stype) {
60!
21
    case DND_STAT_INIT:
15✔
22
      return "init";
15✔
23
    case DND_STAT_RUNNING:
30✔
24
      return "running";
30✔
25
    case DND_STAT_STOPPED:
15✔
26
      return "stopped";
15✔
27
    default:
×
28
      return "UNKNOWN";
×
29
  }
30
}
31

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

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

56
  return taosArrayPush(pArray, &handle);
4,620✔
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);
×
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; }
364✔
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