Add the timestamp time into the logfile header too.
When a message goes to a remote and the timestamp comes back,
we log both the time it got to the remote, and the time that the
timestamp made it back home. This wasn't exposed in the header
previously, so we couldn't use it for sorting.
When you get a short log file with a reboot on the remote, it is very
helpful to have access to all the timestamp pairs for all network
directions. This becomes more important when we start to realize that
reliable timestamps are much less helpful due to their ambiguity. In at
least one log file I've looked at, this extra data would have made it
sortable.
As with the reliable timestamp field in the header, let's get this
logged before we are using it. The code to use this should be pretty
straight forwards, and the tests confirm that the field is correct.
Change-Id: Ia7e4d6ae2055f6ed809ae50f8aa3ee9535124aa1
Signed-off-by: Austin Schuh <austin.schuh@bluerivertech.com>
diff --git a/aos/events/logging/log_namer.cc b/aos/events/logging/log_namer.cc
index ceeba95..f269f43 100644
--- a/aos/events/logging/log_namer.cc
+++ b/aos/events/logging/log_namer.cc
@@ -18,10 +18,13 @@
namespace logger {
NewDataWriter::NewDataWriter(LogNamer *log_namer, const Node *node,
+ const Node *logger_node,
std::function<void(NewDataWriter *)> reopen,
std::function<void(NewDataWriter *)> close)
: node_(node),
node_index_(configuration::GetNodeIndex(log_namer->configuration_, node)),
+ logger_node_index_(
+ configuration::GetNodeIndex(log_namer->configuration_, logger_node)),
log_namer_(log_namer),
reopen_(std::move(reopen)),
close_(std::move(close)) {
@@ -61,7 +64,10 @@
monotonic_clock::max_time;
state.oldest_remote_reliable_monotonic_timestamp =
monotonic_clock::max_time;
- state.oldest_local_reliable_monotonic_timestamp =
+ state.oldest_local_reliable_monotonic_timestamp = monotonic_clock::max_time;
+ state.oldest_logger_remote_unreliable_monotonic_timestamp =
+ monotonic_clock::max_time;
+ state.oldest_logger_local_unreliable_monotonic_timestamp =
monotonic_clock::max_time;
}
@@ -82,8 +88,8 @@
void NewDataWriter::UpdateRemote(
const size_t remote_node_index, const UUID &remote_node_boot_uuid,
const monotonic_clock::time_point monotonic_remote_time,
- const monotonic_clock::time_point monotonic_event_time,
- const bool reliable) {
+ const monotonic_clock::time_point monotonic_event_time, const bool reliable,
+ monotonic_clock::time_point monotonic_timestamp_time) {
// Trigger rotation if anything in the header changes.
bool rotate = false;
CHECK_LT(remote_node_index, state_.size());
@@ -102,7 +108,10 @@
monotonic_clock::max_time;
state.oldest_remote_reliable_monotonic_timestamp =
monotonic_clock::max_time;
- state.oldest_local_reliable_monotonic_timestamp =
+ state.oldest_local_reliable_monotonic_timestamp = monotonic_clock::max_time;
+ state.oldest_logger_remote_unreliable_monotonic_timestamp =
+ monotonic_clock::max_time;
+ state.oldest_logger_local_unreliable_monotonic_timestamp =
monotonic_clock::max_time;
rotate = true;
}
@@ -133,6 +142,27 @@
}
}
+ // Track the logger timestamps too.
+ if (monotonic_timestamp_time != monotonic_clock::min_time) {
+ State &logger_state = state_[node_index_];
+ CHECK_EQ(remote_node_index, logger_node_index_);
+ if (monotonic_event_time <
+ logger_state.oldest_logger_remote_unreliable_monotonic_timestamp) {
+ VLOG(1)
+ << filename() << " Remote " << node_index_
+ << " oldest_logger_remote_unreliable_monotonic_timestamp updated "
+ "from "
+ << logger_state.oldest_logger_remote_unreliable_monotonic_timestamp
+ << " to " << monotonic_event_time;
+ logger_state.oldest_logger_remote_unreliable_monotonic_timestamp =
+ monotonic_event_time;
+ logger_state.oldest_logger_local_unreliable_monotonic_timestamp =
+ monotonic_timestamp_time;
+
+ rotate = true;
+ }
+ }
+
// Did any of the timestamps change?
if (state.oldest_remote_monotonic_timestamp > monotonic_remote_time) {
VLOG(1) << filename() << " Remote " << remote_node_index
@@ -238,7 +268,7 @@
const UUID &source_node_boot_uuid = state[node_index].boot_uuid;
const Node *const source_node =
configuration::GetNode(configuration_, node_index);
- CHECK_EQ(LogFileHeader::MiniReflectTypeTable()->num_elems, 30u);
+ CHECK_EQ(LogFileHeader::MiniReflectTypeTable()->num_elems, 32u);
flatbuffers::FlatBufferBuilder fbb;
fbb.ForceDefaults(true);
@@ -298,32 +328,36 @@
int64_t *unused;
flatbuffers::Offset<flatbuffers::Vector<int64_t>>
- oldest_remote_monotonic_timestamps_offset = fbb.CreateUninitializedVector(
- state.size(), &unused);
+ oldest_remote_monotonic_timestamps_offset =
+ fbb.CreateUninitializedVector(state.size(), &unused);
flatbuffers::Offset<flatbuffers::Vector<int64_t>>
- oldest_local_monotonic_timestamps_offset = fbb.CreateUninitializedVector(
- state.size(), &unused);
+ oldest_local_monotonic_timestamps_offset =
+ fbb.CreateUninitializedVector(state.size(), &unused);
flatbuffers::Offset<flatbuffers::Vector<int64_t>>
oldest_remote_unreliable_monotonic_timestamps_offset =
- fbb.CreateUninitializedVector(
- state.size(), &unused);
+ fbb.CreateUninitializedVector(state.size(), &unused);
flatbuffers::Offset<flatbuffers::Vector<int64_t>>
oldest_local_unreliable_monotonic_timestamps_offset =
- fbb.CreateUninitializedVector(
- state.size(), &unused);
+ fbb.CreateUninitializedVector(state.size(), &unused);
flatbuffers::Offset<flatbuffers::Vector<int64_t>>
oldest_remote_reliable_monotonic_timestamps_offset =
- fbb.CreateUninitializedVector(
- state.size(), &unused);
+ fbb.CreateUninitializedVector(state.size(), &unused);
flatbuffers::Offset<flatbuffers::Vector<int64_t>>
oldest_local_reliable_monotonic_timestamps_offset =
- fbb.CreateUninitializedVector(
- state.size(), &unused);
+ fbb.CreateUninitializedVector(state.size(), &unused);
+
+ flatbuffers::Offset<flatbuffers::Vector<int64_t>>
+ oldest_logger_remote_unreliable_monotonic_timestamps_offset =
+ fbb.CreateUninitializedVector(state.size(), &unused);
+
+ flatbuffers::Offset<flatbuffers::Vector<int64_t>>
+ oldest_logger_local_unreliable_monotonic_timestamps_offset =
+ fbb.CreateUninitializedVector(state.size(), &unused);
for (size_t i = 0; i < state.size(); ++i) {
if (state[i].boot_uuid != UUID::Zero()) {
@@ -344,6 +378,10 @@
monotonic_clock::max_time);
CHECK_EQ(state[i].oldest_local_reliable_monotonic_timestamp,
monotonic_clock::max_time);
+ CHECK_EQ(state[i].oldest_logger_remote_unreliable_monotonic_timestamp,
+ monotonic_clock::max_time);
+ CHECK_EQ(state[i].oldest_logger_local_unreliable_monotonic_timestamp,
+ monotonic_clock::max_time);
}
flatbuffers::GetMutableTemporaryPointer(
@@ -381,6 +419,19 @@
i, state[i]
.oldest_local_reliable_monotonic_timestamp.time_since_epoch()
.count());
+
+ flatbuffers::GetMutableTemporaryPointer(
+ fbb, oldest_logger_remote_unreliable_monotonic_timestamps_offset)
+ ->Mutate(i, state[i]
+ .oldest_logger_remote_unreliable_monotonic_timestamp
+ .time_since_epoch()
+ .count());
+ flatbuffers::GetMutableTemporaryPointer(
+ fbb, oldest_logger_local_unreliable_monotonic_timestamps_offset)
+ ->Mutate(i, state[i]
+ .oldest_logger_local_unreliable_monotonic_timestamp
+ .time_since_epoch()
+ .count());
}
flatbuffers::Offset<
@@ -467,6 +518,12 @@
oldest_remote_reliable_monotonic_timestamps_offset);
log_file_header_builder.add_oldest_local_reliable_monotonic_timestamps(
oldest_local_reliable_monotonic_timestamps_offset);
+ log_file_header_builder
+ .add_oldest_logger_remote_unreliable_monotonic_timestamps(
+ oldest_logger_remote_unreliable_monotonic_timestamps_offset);
+ log_file_header_builder
+ .add_oldest_logger_local_unreliable_monotonic_timestamps(
+ oldest_logger_local_unreliable_monotonic_timestamps_offset);
fbb.FinishSizePrefixed(log_file_header_builder.Finish());
aos::SizePrefixedFlatbufferDetachedBuffer<LogFileHeader> result(
fbb.Release());
@@ -608,13 +665,14 @@
nodes_.emplace_back(source_node);
}
- NewDataWriter data_writer(this, source_node,
- [this, channel](NewDataWriter *data_writer) {
- OpenWriter(channel, data_writer);
- },
- [this](NewDataWriter *data_writer) {
- CloseWriter(&data_writer->writer);
- });
+ NewDataWriter data_writer(
+ this, source_node, node_,
+ [this, channel](NewDataWriter *data_writer) {
+ OpenWriter(channel, data_writer);
+ },
+ [this](NewDataWriter *data_writer) {
+ CloseWriter(&data_writer->writer);
+ });
return &(
data_writers_.emplace(channel, std::move(data_writer)).first->second);
}
@@ -632,14 +690,14 @@
nodes_.emplace_back(node);
}
- NewDataWriter data_writer(this, configuration::GetNode(configuration_, node),
- [this, channel](NewDataWriter *data_writer) {
- OpenForwardedTimestampWriter(channel,
- data_writer);
- },
- [this](NewDataWriter *data_writer) {
- CloseWriter(&data_writer->writer);
- });
+ NewDataWriter data_writer(
+ this, configuration::GetNode(configuration_, node), node_,
+ [this, channel](NewDataWriter *data_writer) {
+ OpenForwardedTimestampWriter(channel, data_writer);
+ },
+ [this](NewDataWriter *data_writer) {
+ CloseWriter(&data_writer->writer);
+ });
return &(
data_writers_.emplace(channel, std::move(data_writer)).first->second);
}
@@ -704,7 +762,7 @@
void MultiNodeLogNamer::OpenDataWriter() {
if (!data_writer_) {
data_writer_ = std::make_unique<NewDataWriter>(
- this, node_,
+ this, node_, node_,
[this](NewDataWriter *writer) {
std::string name;
if (node() != nullptr) {
diff --git a/aos/events/logging/log_namer.h b/aos/events/logging/log_namer.h
index 207673d..4a1e74f 100644
--- a/aos/events/logging/log_namer.h
+++ b/aos/events/logging/log_namer.h
@@ -36,7 +36,7 @@
// node is the node whom's prespective we are logging from.
// reopen is called whenever a file needs to be reopened.
// close is called to close that file and extract any statistics.
- NewDataWriter(LogNamer *log_namer, const Node *node,
+ NewDataWriter(LogNamer *log_namer, const Node *node, const Node *logger_node,
std::function<void(NewDataWriter *)> reopen,
std::function<void(NewDataWriter *)> close);
@@ -50,10 +50,14 @@
// Rotates the log file, delaying writing the new header until data arrives.
void Rotate();
+ // Updates all the metadata in the log file about the remote node which this
+ // message is from.
void UpdateRemote(size_t remote_node_index, const UUID &remote_node_boot_uuid,
monotonic_clock::time_point monotonic_remote_time,
monotonic_clock::time_point monotonic_event_time,
- bool reliable);
+ bool reliable,
+ monotonic_clock::time_point monotonic_timestamp_time =
+ monotonic_clock::min_time);
// Queues up a message with the provided boot UUID.
void QueueMessage(flatbuffers::FlatBufferBuilder *fbb,
const UUID &node_boot_uuid,
@@ -107,6 +111,18 @@
// oldest_local_reliable_monotonic_timestamp.
monotonic_clock::time_point oldest_local_reliable_monotonic_timestamp =
monotonic_clock::max_time;
+
+ // Timestamp on the remote monotonic clock of the oldest message timestamp
+ // sent back to logger_node_index_. The remote here will be the node this
+ // part is from the perspective of, ie node_index_.
+ monotonic_clock::time_point
+ oldest_logger_remote_unreliable_monotonic_timestamp =
+ monotonic_clock::max_time;
+ // The time on the monotonic clock of the logger when this timestamp made it
+ // back to the logger (logger_node_index_).
+ monotonic_clock::time_point
+ oldest_logger_local_unreliable_monotonic_timestamp =
+ monotonic_clock::max_time;
};
private:
@@ -122,6 +138,7 @@
const Node *node_ = nullptr;
size_t node_index_ = 0;
+ size_t logger_node_index_ = 0;
LogNamer *log_namer_;
UUID parts_uuid_ = UUID::Random();
size_t parts_index_ = 0;
@@ -280,14 +297,15 @@
const aos::Node *node)
: LogNamer(event_loop->configuration(), event_loop, node),
base_name_(base_name),
- data_writer_(this, node,
- [this](NewDataWriter *writer) {
- writer->writer = std::make_unique<DetachedBufferWriter>(
- absl::StrCat(base_name_, ".part",
- writer->parts_index(), ".bfbs"),
- std::make_unique<aos::logger::DummyEncoder>());
- },
- [](NewDataWriter * /*writer*/) {}) {}
+ data_writer_(
+ this, node, event_loop->node(),
+ [this](NewDataWriter *writer) {
+ writer->writer = std::make_unique<DetachedBufferWriter>(
+ absl::StrCat(base_name_, ".part", writer->parts_index(),
+ ".bfbs"),
+ std::make_unique<aos::logger::DummyEncoder>());
+ },
+ [](NewDataWriter * /*writer*/) {}) {}
LocalLogNamer(const LocalLogNamer &) = delete;
LocalLogNamer(LocalLogNamer &&) = delete;
diff --git a/aos/events/logging/log_writer.cc b/aos/events/logging/log_writer.cc
index 5931200..0e1dece 100644
--- a/aos/events/logging/log_writer.cc
+++ b/aos/events/logging/log_writer.cc
@@ -729,10 +729,10 @@
message_header_builder.add_remote_queue_index(
msg->remote_queue_index());
+ const aos::monotonic_clock::time_point monotonic_timestamp_time =
+ f.fetcher->context().monotonic_event_time;
message_header_builder.add_monotonic_timestamp_time(
- f.fetcher->context()
- .monotonic_event_time.time_since_epoch()
- .count());
+ monotonic_timestamp_time.time_since_epoch().count());
fbb.FinishSizePrefixed(message_header_builder.Finish());
const auto end = event_loop_->monotonic_now();
@@ -755,7 +755,7 @@
chrono::nanoseconds(msg->monotonic_remote_time())),
monotonic_clock::time_point(
chrono::nanoseconds(msg->monotonic_sent_time())),
- reliable);
+ reliable, monotonic_timestamp_time);
f.contents_writer->QueueMessage(
&fbb, UUID::FromVector(msg->boot_uuid()), end);
diff --git a/aos/events/logging/logfile_sorting.cc b/aos/events/logging/logfile_sorting.cc
index 2cea8b5..f8d33c3 100644
--- a/aos/events/logging/logfile_sorting.cc
+++ b/aos/events/logging/logfile_sorting.cc
@@ -93,7 +93,7 @@
}
bool ConfigOnly(const LogFileHeader *header) {
- CHECK_EQ(LogFileHeader::MiniReflectTypeTable()->num_elems, 30u);
+ CHECK_EQ(LogFileHeader::MiniReflectTypeTable()->num_elems, 32u);
if (header->has_monotonic_start_time()) return false;
if (header->has_realtime_start_time()) return false;
if (header->has_max_out_of_order_duration()) return false;
@@ -119,6 +119,8 @@
if (header->has_oldest_local_unreliable_monotonic_timestamps()) return false;
if (header->has_oldest_remote_reliable_monotonic_timestamps()) return false;
if (header->has_oldest_local_reliable_monotonic_timestamps()) return false;
+ if (header->has_oldest_logger_remote_unreliable_monotonic_timestamps()) return false;
+ if (header->has_oldest_logger_local_unreliable_monotonic_timestamps()) return false;
return header->has_configuration();
}
diff --git a/aos/events/logging/logger.fbs b/aos/events/logging/logger.fbs
index 72ffe33..7d6eed4 100644
--- a/aos/events/logging/logger.fbs
+++ b/aos/events/logging/logger.fbs
@@ -185,6 +185,12 @@
// same quantity.
oldest_remote_reliable_monotonic_timestamps:[int64] (id: 28);
oldest_local_reliable_monotonic_timestamps:[int64] (id: 29);
+
+ // For all the remote timestamps which come back to the logger. The "local"
+ // time here is the logger node boot, and "remote" is the node which sent the
+ // timestamps.
+ oldest_logger_remote_unreliable_monotonic_timestamps:[int64] (id: 30);
+ oldest_logger_local_unreliable_monotonic_timestamps:[int64] (id: 31);
}
// Table holding a message.
diff --git a/aos/events/logging/logger_test.cc b/aos/events/logging/logger_test.cc
index e558422..1732549 100644
--- a/aos/events/logging/logger_test.cc
+++ b/aos/events/logging/logger_test.cc
@@ -2334,6 +2334,7 @@
// Tests that we properly populate and extract the logger_start time by setting
// up a clock difference between 2 nodes and looking at the resulting parts.
TEST_P(MultinodeLoggerTest, LoggerStartTime) {
+ std::vector<std::string> actual_filenames;
time_converter_.AddMonotonic(
{BootTimestamp::epoch(), BootTimestamp::epoch() + chrono::seconds(1000)});
{
@@ -2344,8 +2345,14 @@
StartLogger(&pi2_logger);
event_loop_factory_.RunFor(chrono::milliseconds(10000));
+
+ pi1_logger.AppendAllFilenames(&actual_filenames);
+ pi2_logger.AppendAllFilenames(&actual_filenames);
}
+ ASSERT_THAT(actual_filenames,
+ ::testing::UnorderedElementsAreArray(logfiles_));
+
for (const LogFile &log_file : SortParts(logfiles_)) {
for (const LogParts &log_part : log_file.parts) {
if (log_part.node == log_file.logger_node) {
@@ -2616,6 +2623,22 @@
log_header->message()
.oldest_local_reliable_monotonic_timestamps()
->Get(1)));
+ const monotonic_clock::time_point
+ oldest_logger_remote_unreliable_monotonic_timestamps =
+ monotonic_clock::time_point(chrono::nanoseconds(
+ log_header->message()
+ .oldest_logger_remote_unreliable_monotonic_timestamps()
+ ->Get(0)));
+ const monotonic_clock::time_point
+ oldest_logger_local_unreliable_monotonic_timestamps =
+ monotonic_clock::time_point(chrono::nanoseconds(
+ log_header->message()
+ .oldest_logger_local_unreliable_monotonic_timestamps()
+ ->Get(0)));
+ EXPECT_EQ(oldest_logger_remote_unreliable_monotonic_timestamps,
+ monotonic_clock::max_time);
+ EXPECT_EQ(oldest_logger_local_unreliable_monotonic_timestamps,
+ monotonic_clock::max_time);
switch (log_header->message().parts_index()) {
case 0:
EXPECT_EQ(oldest_remote_monotonic_timestamps,
@@ -2812,6 +2835,32 @@
.oldest_local_unreliable_monotonic_timestamps()
->size(),
2u);
+ ASSERT_TRUE(log_header->message()
+ .has_oldest_remote_reliable_monotonic_timestamps());
+ ASSERT_EQ(log_header->message()
+ .oldest_remote_reliable_monotonic_timestamps()
+ ->size(),
+ 2u);
+ ASSERT_TRUE(log_header->message()
+ .has_oldest_local_reliable_monotonic_timestamps());
+ ASSERT_EQ(log_header->message()
+ .oldest_local_reliable_monotonic_timestamps()
+ ->size(),
+ 2u);
+
+ ASSERT_TRUE(
+ log_header->message()
+ .has_oldest_logger_remote_unreliable_monotonic_timestamps());
+ ASSERT_EQ(log_header->message()
+ .oldest_logger_remote_unreliable_monotonic_timestamps()
+ ->size(),
+ 2u);
+ ASSERT_TRUE(log_header->message()
+ .has_oldest_logger_local_unreliable_monotonic_timestamps());
+ ASSERT_EQ(log_header->message()
+ .oldest_logger_local_unreliable_monotonic_timestamps()
+ ->size(),
+ 2u);
if (log_header->message().node()->name()->string_view() != "pi1") {
ASSERT_TRUE(file.find("aos.message_bridge.RemoteMessage") !=
@@ -2830,11 +2879,16 @@
const monotonic_clock::time_point
expected_oldest_remote_monotonic_timestamps(
chrono::nanoseconds(msg->message().monotonic_remote_time()));
+ const monotonic_clock::time_point
+ expected_oldest_timestamp_monotonic_timestamps(
+ chrono::nanoseconds(msg->message().monotonic_timestamp_time()));
EXPECT_NE(expected_oldest_local_monotonic_timestamps,
monotonic_clock::min_time);
EXPECT_NE(expected_oldest_remote_monotonic_timestamps,
monotonic_clock::min_time);
+ EXPECT_NE(expected_oldest_timestamp_monotonic_timestamps,
+ monotonic_clock::min_time);
++timestamp_file_count;
// Since the log file is from the perspective of the other node,
@@ -2870,6 +2924,18 @@
log_header->message()
.oldest_local_reliable_monotonic_timestamps()
->Get(0)));
+ const monotonic_clock::time_point
+ oldest_logger_remote_unreliable_monotonic_timestamps =
+ monotonic_clock::time_point(chrono::nanoseconds(
+ log_header->message()
+ .oldest_logger_remote_unreliable_monotonic_timestamps()
+ ->Get(1)));
+ const monotonic_clock::time_point
+ oldest_logger_local_unreliable_monotonic_timestamps =
+ monotonic_clock::time_point(chrono::nanoseconds(
+ log_header->message()
+ .oldest_logger_local_unreliable_monotonic_timestamps()
+ ->Get(1)));
const Channel *channel =
event_loop_factory_.configuration()->channels()->Get(
@@ -2881,6 +2947,10 @@
const bool reliable = connection->time_to_live() == 0;
+ SCOPED_TRACE(file);
+ SCOPED_TRACE(aos::FlatbufferToJson(
+ *log_header, {.multi_line = true, .max_vector_size = 100}));
+
if (shared()) {
// Confirm that the oldest timestamps match what we expect. Based on
// what we are doing, we know that the oldest time is the first
@@ -2894,6 +2964,11 @@
expected_oldest_remote_monotonic_timestamps);
EXPECT_EQ(oldest_local_monotonic_timestamps,
expected_oldest_local_monotonic_timestamps);
+ EXPECT_EQ(oldest_logger_remote_unreliable_monotonic_timestamps,
+ expected_oldest_local_monotonic_timestamps) << file;
+ EXPECT_EQ(oldest_logger_local_unreliable_monotonic_timestamps,
+ expected_oldest_timestamp_monotonic_timestamps) << file;
+
if (reliable) {
EXPECT_EQ(oldest_remote_reliable_monotonic_timestamps,
expected_oldest_remote_monotonic_timestamps);
@@ -2919,6 +2994,10 @@
monotonic_clock::epoch() + chrono::nanoseconds(90000000));
EXPECT_EQ(oldest_local_monotonic_timestamps,
monotonic_clock::epoch() + chrono::nanoseconds(90150000));
+ EXPECT_EQ(oldest_logger_remote_unreliable_monotonic_timestamps,
+ monotonic_clock::epoch() + chrono::nanoseconds(90150000));
+ EXPECT_EQ(oldest_logger_local_unreliable_monotonic_timestamps,
+ monotonic_clock::epoch() + chrono::nanoseconds(90250000));
if (reliable) {
EXPECT_EQ(oldest_remote_reliable_monotonic_timestamps,
expected_oldest_remote_monotonic_timestamps);
@@ -2948,6 +3027,10 @@
EXPECT_EQ(
oldest_local_monotonic_timestamps,
monotonic_clock::epoch() + chrono::nanoseconds(1323100000));
+ EXPECT_EQ(oldest_logger_remote_unreliable_monotonic_timestamps,
+ expected_oldest_local_monotonic_timestamps) << file;
+ EXPECT_EQ(oldest_logger_local_unreliable_monotonic_timestamps,
+ expected_oldest_timestamp_monotonic_timestamps) << file;
if (reliable) {
EXPECT_EQ(oldest_remote_reliable_monotonic_timestamps,
expected_oldest_remote_monotonic_timestamps);
@@ -2970,7 +3053,6 @@
break;
case 3:
- LOG(INFO) << "Shared";
EXPECT_EQ(
oldest_remote_monotonic_timestamps,
monotonic_clock::epoch() + chrono::nanoseconds(10000000000));
@@ -2981,6 +3063,12 @@
expected_oldest_remote_monotonic_timestamps);
EXPECT_EQ(oldest_local_unreliable_monotonic_timestamps,
expected_oldest_local_monotonic_timestamps);
+ EXPECT_EQ(
+ oldest_logger_remote_unreliable_monotonic_timestamps,
+ monotonic_clock::epoch() + chrono::nanoseconds(1323100000));
+ EXPECT_EQ(
+ oldest_logger_local_unreliable_monotonic_timestamps,
+ monotonic_clock::epoch() + chrono::nanoseconds(10100200000));
break;
default:
FAIL();
@@ -3004,7 +3092,6 @@
if (shared()) {
EXPECT_EQ(source_node_boot_uuid, pi2_boot1);
EXPECT_EQ(monotonic_start_time, monotonic_clock::min_time);
- LOG(INFO) << "Shared";
break;
}
[[fallthrough]];
@@ -3015,17 +3102,57 @@
} else {
switch (log_header->message().parts_index()) {
case 0:
+ if (reliable) {
+ EXPECT_EQ(oldest_remote_unreliable_monotonic_timestamps,
+ monotonic_clock::max_time);
+ EXPECT_EQ(oldest_local_unreliable_monotonic_timestamps,
+ monotonic_clock::max_time);
+ EXPECT_EQ(
+ oldest_logger_remote_unreliable_monotonic_timestamps,
+ monotonic_clock::epoch() + chrono::nanoseconds(100150000))
+ << file;
+ EXPECT_EQ(
+ oldest_logger_local_unreliable_monotonic_timestamps,
+ monotonic_clock::epoch() + chrono::nanoseconds(100250000))
+ << file;
+ } else {
+ EXPECT_EQ(oldest_remote_unreliable_monotonic_timestamps,
+ expected_oldest_remote_monotonic_timestamps);
+ EXPECT_EQ(oldest_local_unreliable_monotonic_timestamps,
+ expected_oldest_local_monotonic_timestamps);
+ EXPECT_EQ(
+ oldest_logger_remote_unreliable_monotonic_timestamps,
+ monotonic_clock::epoch() + chrono::nanoseconds(90150000))
+ << file;
+ EXPECT_EQ(
+ oldest_logger_local_unreliable_monotonic_timestamps,
+ monotonic_clock::epoch() + chrono::nanoseconds(90250000))
+ << file;
+ }
+ break;
case 1:
if (reliable) {
EXPECT_EQ(oldest_remote_unreliable_monotonic_timestamps,
monotonic_clock::max_time);
EXPECT_EQ(oldest_local_unreliable_monotonic_timestamps,
monotonic_clock::max_time);
+ EXPECT_EQ(
+ oldest_logger_remote_unreliable_monotonic_timestamps,
+ monotonic_clock::epoch() + chrono::nanoseconds(1323100000));
+ EXPECT_EQ(
+ oldest_logger_local_unreliable_monotonic_timestamps,
+ monotonic_clock::epoch() + chrono::nanoseconds(10100200000));
} else {
EXPECT_EQ(oldest_remote_unreliable_monotonic_timestamps,
expected_oldest_remote_monotonic_timestamps);
EXPECT_EQ(oldest_local_unreliable_monotonic_timestamps,
expected_oldest_local_monotonic_timestamps);
+ EXPECT_EQ(
+ oldest_logger_remote_unreliable_monotonic_timestamps,
+ monotonic_clock::epoch() + chrono::nanoseconds(1323150000));
+ EXPECT_EQ(
+ oldest_logger_local_unreliable_monotonic_timestamps,
+ monotonic_clock::epoch() + chrono::nanoseconds(10100250000));
}
break;
default: