diff options
author | Carlos Chinchilla <cachinchilla@google.com> | 2022-03-15 17:47:43 -0700 |
---|---|---|
committer | CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-03-24 17:07:34 +0000 |
commit | d226342689a5e08a27c0c5495029d4cd2ec3f38f (patch) | |
tree | c0ff2efb76c91583341efa3d25d995690cf95feb /pw_log_rpc | |
parent | 78877940b31e34cb76b5838605fe8852d965b922 (diff) | |
download | pigweed-d226342689a5e08a27c0c5495029d4cd2ec3f38f.tar.gz |
pw_multisink: Track & report ingress drops
Track drops of entries that could not be added to the MultiSink and
report this count separate from the drop count when a slow drain is
advanced.
Change-Id: I3f60bc9fd64b2bfc78c6975f5ac0d470ec5b60a7
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/88321
Reviewed-by: Keir Mierle <keir@google.com>
Commit-Queue: Carlos Chinchilla <cachinchilla@google.com>
Diffstat (limited to 'pw_log_rpc')
-rw-r--r-- | pw_log_rpc/rpc_log_drain.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/pw_log_rpc/rpc_log_drain.cc b/pw_log_rpc/rpc_log_drain.cc index b3bee863f..8b7957142 100644 --- a/pw_log_rpc/rpc_log_drain.cc +++ b/pw_log_rpc/rpc_log_drain.cc @@ -129,8 +129,12 @@ RpcLogDrain::LogDrainState RpcLogDrain::EncodeOutgoingPacket( do { // Peek entry and get drop count from multisink. uint32_t drop_count = 0; + uint32_t ingress_drop_count = 0; Result<multisink::MultiSink::Drain::PeekedEntry> possible_entry = - PeekEntry(log_entry_buffer_, drop_count); + PeekEntry(log_entry_buffer_, drop_count, ingress_drop_count); + // TODO(cachinchilla): remove combining these two drop types when reporting + // drop reasons individually. + drop_count += ingress_drop_count; // Check if the entry fits in the entry buffer. if (possible_entry.status().IsResourceExhausted()) { @@ -189,7 +193,8 @@ RpcLogDrain::LogDrainState RpcLogDrain::EncodeOutgoingPacket( committed_entry_drop_count_ = 0; } if (possible_entry.ok()) { - PW_CHECK_OK(PeekEntry(log_entry_buffer_, drop_count).status()); + PW_CHECK_OK(PeekEntry(log_entry_buffer_, drop_count, ingress_drop_count) + .status()); } } |