Send out timing report before dying on SendTooFast
Adam and I were debugging message_bridge_auth_client crashing, and
noticed that the last timing report wasn't coming out, so we couldn't
see what was happening right before it crashed. For the too far behind
crash, we do it, so do it here too.
Change-Id: I2357069ed26d03c0d28cea9c0e68e9a058bbe0bd
Signed-off-by: James Kuszmaul <james.kuszmaul@bluerivertech.com>
diff --git a/aos/events/event_loop.cc b/aos/events/event_loop.cc
index 2122814..ba71b97 100644
--- a/aos/events/event_loop.cc
+++ b/aos/events/event_loop.cc
@@ -62,8 +62,12 @@
}
void RawSender::CheckOk(const RawSender::Error err) {
- CHECK_EQ(err, Error::kOk) << "Messages were sent too fast on channel: "
- << configuration::CleanedChannelToString(channel_);
+ if (err != Error::kOk) {
+ event_loop_->SendTimingReport();
+ CHECK_EQ(err, Error::kOk)
+ << "Messages were sent too fast on channel: "
+ << configuration::CleanedChannelToString(channel_);
+ }
}
RawSender::RawSender(EventLoop *event_loop, const Channel *channel)