MCPcopy Create free account
hub / github.com/Icinga/icinga2 / pString

Method pString

plugins/thresholds.cpp:96–118  ·  view source on GitHub ↗

returns a printable string of the threshold

Source from the content-addressed store, hash-verified

94
95//returns a printable string of the threshold
96std::wstring threshold::pString(const double max)
97{
98 if (!set)
99 return L"";
100 //transform percentages to abolute values
101 double lowerAbs = lower;
102 double upperAbs = upper;
103 if (perc) {
104 lowerAbs = lower / 100.0 * max;
105 upperAbs = upper / 100.0 * max;
106 }
107
108 std::wstring s, lowerStr = removeZero(lowerAbs),
109 upperStr = removeZero(upperAbs);
110
111 if (lower != upper) {
112 s.append(L"[").append(lowerStr).append(L"-")
113 .append(upperStr).append(L"]");
114 } else
115 s.append(lowerStr);
116
117 return s;
118}
119
120threshold threshold::toSeconds(const Tunit& fromUnit) {
121 if (!set)

Callers 10

printOutputFunction · 0.80
printOutputFunction · 0.80
printOutputFunction · 0.80
printOutputFunction · 0.80
printOutputFunction · 0.80
printOutputFunction · 0.80
printOutputFunction · 0.80
printOutputFunction · 0.80
printOutputFunction · 0.80
printOutputFunction · 0.80

Calls 1

removeZeroFunction · 0.85

Tested by

no test coverage detected