MCPcopy Create free account
hub / github.com/PurpleI2P/i2pd / ShowTraffic

Function ShowTraffic

daemon/HTTPServer.cpp:129–142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127 }
128
129 static void ShowTraffic (std::stringstream& s, uint64_t bytes)
130 {
131 s << std::fixed << std::setprecision(2);
132 auto numKBytes = (double) bytes / 1024;
133 if (numKBytes < 1024)
134 /* Kibibyte */
135 s << numKBytes << " KiB";
136 else if (numKBytes < 1024 * 1024)
137 /* Mebibyte */
138 s << (numKBytes / 1024) << " MiB" ;
139 else
140 /* Gibibyte */
141 s << (numKBytes / 1024 / 1024) << " GiB";
142 }
143
144 static void ShowTunnelDetails (std::stringstream& s, enum i2p::tunnel::TunnelState eState, bool explr, int bytes)
145 {

Callers 3

ShowTunnelDetailsFunction · 0.85
ShowStatusFunction · 0.85
ShowTransitTunnelsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected