Track send failures in timing reports
Previously, there was no external indication of the number of
failed sends. Start tracking failures by cause, so that
we have at least some visibility.
Change-Id: Ia66c9a8fa7bb580b786d435ce3dbdca242e2c80f
Signed-off-by: James Kuszmaul <james.kuszmaul@bluerivertech.com>
diff --git a/aos/events/timing_statistics.cc b/aos/events/timing_statistics.cc
index 52f2048..fbc49f4 100644
--- a/aos/events/timing_statistics.cc
+++ b/aos/events/timing_statistics.cc
@@ -40,6 +40,19 @@
size.Reset();
sender->mutate_count(0);
+ for (size_t ii = 0; ii < kNumErrors; ++ii) {
+ sender->mutable_error_counts()->GetMutableObject(ii)->mutate_count(0);
+ }
+}
+
+void RawSenderTiming::IncrementError(timing::SendError error) {
+ if (!sender) {
+ return;
+ }
+ const size_t index = static_cast<size_t>(error);
+ timing::SendErrorCount *counter =
+ sender->mutable_error_counts()->GetMutableObject(index);
+ counter->mutate_count(counter->count() + 1);
}
void TimerTiming::set_timing_report(timing::Timer *new_timer) {