Fix IPC message e2e hiding

This commit is contained in:
Jacob Dufault 2017-06-13 23:59:40 -07:00
parent 3d0b8fd807
commit 14009293ba
3 changed files with 16 additions and 14 deletions

View File

@ -59,18 +59,6 @@ const int kExpectedClientVersion = 2;
#if false
std::string FormatMicroseconds(long long microseconds) {
long long milliseconds = microseconds / 1000;
long long remaining = microseconds - milliseconds;
// Only show two digits after the dot.
while (remaining >= 100)
remaining /= 10;
return std::to_string(milliseconds) + "." + std::to_string(remaining) + "ms";
}
#endif
@ -3426,7 +3414,7 @@ void StdoutMain(std::unordered_map<IpcId, Timer>* request_times, MultiQueueWaite
case IpcId::Cout: {
auto msg = static_cast<Ipc_Cout*>(message.get());
if (ShouldDisplayIpcTiming(message->method_id)) {
if (ShouldDisplayIpcTiming(msg->original_ipc_id)) {
Timer time = (*request_times)[msg->original_ipc_id];
time.ResetAndPrint("[e2e] Running " + std::string(IpcIdToString(msg->original_ipc_id)));
}

View File

@ -322,3 +322,15 @@ float GetProcessMemoryUsedInMb() {
return memory_after / kBytesToMb;
#endif
}
std::string FormatMicroseconds(long long microseconds) {
long long milliseconds = microseconds / 1000;
long long remaining = microseconds - milliseconds;
// Only show two digits after the dot.
while (remaining >= 100)
remaining /= 10;
return std::to_string(milliseconds) + "." + std::to_string(remaining) + "ms";
}

View File

@ -130,4 +130,6 @@ inline void hash_combine(std::size_t& seed, const T& v, Rest... rest) {
};\
}
float GetProcessMemoryUsedInMb();
float GetProcessMemoryUsedInMb();
std::string FormatMicroseconds(long long microseconds);