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

Method toSeconds

plugins/thresholds.cpp:120–147  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

118}
119
120threshold threshold::toSeconds(const Tunit& fromUnit) {
121 if (!set)
122 return *this;
123
124 double lowerAbs = lower;
125 double upperAbs = upper;
126
127 switch (fromUnit) {
128 case TunitMS:
129 lowerAbs = lowerAbs / 1000;
130 upperAbs = upperAbs / 1000;
131 break;
132 case TunitS:
133 lowerAbs = lowerAbs ;
134 upperAbs = upperAbs ;
135 break;
136 case TunitM:
137 lowerAbs = lowerAbs * 60;
138 upperAbs = upperAbs * 60;
139 break;
140 case TunitH:
141 lowerAbs = lowerAbs * 60 * 60;
142 upperAbs = upperAbs * 60 * 60;
143 break;
144 }
145
146 return threshold(lowerAbs, upperAbs, legal, perc);
147}
148
149std::wstring removeZero(double val)
150{

Callers 1

printOutputFunction · 0.80

Calls 1

thresholdClass · 0.85

Tested by

no test coverage detected