| 67 | } |
| 68 | |
| 69 | std::string openhd::bytes_per_second_to_string(double bytes_per_second) { |
| 70 | const auto bits_per_second = bytes_per_second * 8; |
| 71 | std::stringstream ss; |
| 72 | ss.precision(2); |
| 73 | if (bits_per_second > 1000 * 1000) { |
| 74 | const auto mBits_per_second = |
| 75 | static_cast<double>(bits_per_second) / (1000.0 * 1000.0); |
| 76 | ss << mBits_per_second << "mBit/s"; |
| 77 | return ss.str(); |
| 78 | } |
| 79 | const auto kBits_per_second = static_cast<double>(bits_per_second) / 1000; |
| 80 | ss << kBits_per_second << "kBit/s"; |
| 81 | return ss.str(); |
| 82 | } |
| 83 | |
| 84 | std::string openhd::pps_to_string(double pps) { |
| 85 | std::stringstream ss; |
nothing calls this directly
no outgoing calls
no test coverage detected