Switch magic timestamp channel to RemoteMessage
In order to track reboots and such, we really need to communicate more
information from the message_bridge to the logger. It is a shame to
have to modify the MessageHeader to do this, even though it would be
nice. Switch the remote timestamp channels over to a new RemoteMessage
channel instead, and add code to rename the channel when replaying.
There are no known log files with a MessageHeader actually logged, so
most of this should be pretty safe. I've tested this on an old log file
by hand.
Change-Id: If81b31869b95040151d833d20ec3eb8623ab1cd4
diff --git a/aos/events/simulated_event_loop_test.cc b/aos/events/simulated_event_loop_test.cc
index bdf52c1..fb144c3 100644
--- a/aos/events/simulated_event_loop_test.cc
+++ b/aos/events/simulated_event_loop_test.cc
@@ -10,6 +10,7 @@
#include "aos/events/test_message_generated.h"
#include "aos/network/message_bridge_client_generated.h"
#include "aos/network/message_bridge_server_generated.h"
+#include "aos/network/remote_message_generated.h"
#include "aos/network/timestamp_generated.h"
#include "gtest/gtest.h"
@@ -19,10 +20,11 @@
std::string ConfigPrefix() { return "aos/"; }
-} // namespace
-
+using message_bridge::RemoteMessage;
namespace chrono = ::std::chrono;
+} // namespace
+
class SimulatedEventLoopTestFactory : public EventLoopTestFactory {
public:
::std::unique_ptr<EventLoop> Make(std::string_view name) override {
@@ -422,9 +424,9 @@
pi3_pong_counter_event_loop.get(), "/pi3/aos");
// Count remote timestamps
- MessageCounter<logger::MessageHeader> remote_timestamps_pi2_on_pi1(
+ MessageCounter<RemoteMessage> remote_timestamps_pi2_on_pi1(
pi1_pong_counter_event_loop.get(), "/aos/remote_timestamps/pi2");
- MessageCounter<logger::MessageHeader> remote_timestamps_pi1_on_pi2(
+ MessageCounter<RemoteMessage> remote_timestamps_pi1_on_pi2(
pi2_pong_counter_event_loop.get(), "/aos/remote_timestamps/pi1");
// Wait to let timestamp estimation start up before looking for the results.
@@ -575,7 +577,7 @@
"/pi1/aos/remote_timestamps/pi2",
[pi1_timestamp_channel, ping_timestamp_channel, &ping_on_pi2_fetcher,
&ping_on_pi1_fetcher, &pi1_on_pi2_timestamp_fetcher,
- &pi1_on_pi1_timestamp_fetcher](const logger::MessageHeader &header) {
+ &pi1_on_pi1_timestamp_fetcher](const RemoteMessage &header) {
VLOG(1) << aos::FlatbufferToJson(&header);
const aos::monotonic_clock::time_point header_monotonic_sent_time(
@@ -825,9 +827,9 @@
pi3_pong_counter_event_loop.get(), "/pi3/aos");
// Count remote timestamps
- MessageCounter<logger::MessageHeader> remote_timestamps_pi2_on_pi1(
+ MessageCounter<RemoteMessage> remote_timestamps_pi2_on_pi1(
pi1_pong_counter_event_loop.get(), "/aos/remote_timestamps/pi2");
- MessageCounter<logger::MessageHeader> remote_timestamps_pi1_on_pi2(
+ MessageCounter<RemoteMessage> remote_timestamps_pi1_on_pi2(
pi2_pong_counter_event_loop.get(), "/aos/remote_timestamps/pi1");
MessageCounter<message_bridge::ServerStatistics>
@@ -1023,7 +1025,7 @@
pi1_remote_timestamp->MakeWatcher(
"/pi1/aos/remote_timestamps/pi2",
[reliable_channel_index,
- &reliable_timestamp_count](const logger::MessageHeader &header) {
+ &reliable_timestamp_count](const RemoteMessage &header) {
VLOG(1) << aos::FlatbufferToJson(&header);
if (header.channel_index() == reliable_channel_index) {
++reliable_timestamp_count;