Skip to content

Commit 1c1186c

Browse files
committed
Fix CI and address self comments
1 parent 2c393c9 commit 1c1186c

File tree

2 files changed

+27
-10
lines changed

2 files changed

+27
-10
lines changed

src/messaging/ReliableMessageAnalyticsDelegate.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ class ReliableMessageAnalyticsDelegate
3434
virtual ~ReliableMessageAnalyticsDelegate() = default;
3535
enum class EventType
3636
{
37+
kUndefined,
3738
kInitialSend,
3839
kRetransmission,
3940
kAcknowledged,
4041
kFailed,
41-
kUndefined, /* Should be last element in enum */
4242
};
4343

4444
struct TransmitEvent

src/messaging/ReliableMessageMgr.cpp

+26-9
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,14 @@ void ReliableMessageMgr::ExecuteActions()
157157

158158
if (mAnalyticsDelegate)
159159
{
160+
#if !CHIP_PROGRESS_LOGGING
161+
auto fabricIndex = sessionHandle->GetFabricIndex();
162+
auto destination = kUndefinedNodeId;
163+
if (sessionHandle->IsSecureSession())
164+
{
165+
destination = sessionHandle->AsSecureSession()->GetPeerNodeId();
166+
}
167+
#endif // !CHIP_PROGRESS_LOGGING
160168
ReliableMessageAnalyticsDelegate::TransmitEvent event = { .nodeId = destination,
161169
.fabricIndex = fabricIndex,
162170
.eventType =
@@ -546,11 +554,29 @@ void ReliableMessageMgr::CalculateNextRetransTime(RetransTableEntry & entry)
546554
peerIsActive = sessionHandle->AsUnauthenticatedSession()->IsPeerActive();
547555
}
548556

557+
ChipLogProgress(ExchangeManager,
558+
"??%d [E:" ChipLogFormatExchange " S:%u M:" ChipLogFormatMessageCounter
559+
"] (%s) Msg Retransmission to %u:" ChipLogFormatX64 " scheduled for %" PRIu32
560+
"ms from now [State:%s II:%" PRIu32 " AI:%" PRIu32 " AT:%u]",
561+
entry.sendCount + 1, ChipLogValueExchange(&entry.ec.Get()), sessionHandle->SessionIdForLogging(),
562+
messageCounter, Transport::GetSessionTypeString(sessionHandle), fabricIndex, ChipLogValueX64(destination),
563+
backoff.count(), peerIsActive ? "Active" : "Idle", config.mIdleRetransTimeout.count(),
564+
config.mActiveRetransTimeout.count(), config.mActiveThresholdTime.count());
565+
#endif // CHIP_PROGRESS_LOGGING
566+
549567
// For initial send the packet has already been submitted to transport layer successfully.
550568
// On re-transmits we do not know if transport layer is unable to retransmit for some
551569
// reason, so saying we have sent re-transmit here is a little presumptuous.
552570
if (mAnalyticsDelegate)
553571
{
572+
#if !CHIP_PROGRESS_LOGGING
573+
auto fabricIndex = sessionHandle->GetFabricIndex();
574+
auto destination = kUndefinedNodeId;
575+
if (sessionHandle->IsSecureSession())
576+
{
577+
destination = sessionHandle->AsSecureSession()->GetPeerNodeId();
578+
}
579+
#endif // !CHIP_PROGRESS_LOGGING
554580
ReliableMessageAnalyticsDelegate::TransmitEvent event = {
555581
.nodeId = destination,
556582
.fabricIndex = fabricIndex,
@@ -562,15 +588,6 @@ void ReliableMessageMgr::CalculateNextRetransTime(RetransTableEntry & entry)
562588
mAnalyticsDelegate->OnTransmitEvent(event);
563589
}
564590

565-
ChipLogProgress(ExchangeManager,
566-
"??%d [E:" ChipLogFormatExchange " S:%u M:" ChipLogFormatMessageCounter
567-
"] (%s) Msg Retransmission to %u:" ChipLogFormatX64 " scheduled for %" PRIu32
568-
"ms from now [State:%s II:%" PRIu32 " AI:%" PRIu32 " AT:%u]",
569-
entry.sendCount + 1, ChipLogValueExchange(&entry.ec.Get()), sessionHandle->SessionIdForLogging(),
570-
messageCounter, Transport::GetSessionTypeString(sessionHandle), fabricIndex, ChipLogValueX64(destination),
571-
backoff.count(), peerIsActive ? "Active" : "Idle", config.mIdleRetransTimeout.count(),
572-
config.mActiveRetransTimeout.count(), config.mActiveThresholdTime.count());
573-
#endif // CHIP_PROGRESS_LOGGING
574591
}
575592

576593
#if CHIP_CONFIG_TEST

0 commit comments

Comments
 (0)