mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-26 23:24:09 +02:00
parent
4f1cb83f31
commit
95712e46d4
@ -63,24 +63,24 @@ Value PerfdataValue::Parse(const String& perfdata)
|
|||||||
boost::algorithm::to_lower(unit);
|
boost::algorithm::to_lower(unit);
|
||||||
|
|
||||||
if (unit == "us") {
|
if (unit == "us") {
|
||||||
value /= 1000 * 1000;
|
value /= 1000.0 * 1000.0;
|
||||||
unit = "seconds";
|
unit = "seconds";
|
||||||
} else if (unit == "ms") {
|
} else if (unit == "ms") {
|
||||||
value /= 1000;
|
value /= 1000.0;
|
||||||
unit = "seconds";
|
unit = "seconds";
|
||||||
} else if (unit == "s") {
|
} else if (unit == "s") {
|
||||||
unit = "seconds";
|
unit = "seconds";
|
||||||
} else if (unit == "tb") {
|
} else if (unit == "tb") {
|
||||||
value *= 1024 * 1024 * 1024 * 1024;
|
value *= 1024.0 * 1024.0 * 1024.0 * 1024.0;
|
||||||
unit = "bytes";
|
unit = "bytes";
|
||||||
} else if (unit == "gb") {
|
} else if (unit == "gb") {
|
||||||
value *= 1024 * 1024 * 1024;
|
value *= 1024.0 * 1024.0 * 1024.0;
|
||||||
unit = "bytes";
|
unit = "bytes";
|
||||||
} else if (unit == "mb") {
|
} else if (unit == "mb") {
|
||||||
value *= 1024 * 1024;
|
value *= 1024.0 * 1024.0;
|
||||||
unit = "bytes";
|
unit = "bytes";
|
||||||
} else if (unit == "kb") {
|
} else if (unit == "kb") {
|
||||||
value *= 1024;
|
value *= 1024.0;
|
||||||
unit = "bytes";
|
unit = "bytes";
|
||||||
} else if (unit == "b") {
|
} else if (unit == "b") {
|
||||||
unit = "bytes";
|
unit = "bytes";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user