Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding MRP analytics delegate #37439

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

tehampson
Copy link
Contributor

This is a starting point for MRP events to be sent to some sort of delegate for analytic purposes.

The design is intentionally done in this way to reduce code size within the SDK and is meant for applications such as a controller to registers a delegate so code size create but adding this in is completely up to the application to make

Testing

  • Added unit test to validate events are sent as expected.
  • Ran locally with ./scripts/build/build_examples.py --target linux-x64-tests build
  • CI passes

This is a starting point for MRP events to be sent to some sort
of delegate interested.

The design is intentionally done in this way to reduce code size
within the SDK and is meant for applications such as a controller
to registers a delegate for MRP events allowing for it to construct
analytics.
Copy link

Review changes with  SemanticDiff

kRetransmission,
kAcknowledged,
kFailed,
kUndefined, /* Should be last element in enum */
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this should be the first element 🤷

@@ -511,6 +546,22 @@ void ReliableMessageMgr::CalculateNextRetransTime(RetransTableEntry & entry)
peerIsActive = sessionHandle->AsUnauthenticatedSession()->IsPeerActive();
}

// For initial send the packet has already been submitted to transport layer successfully.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do people feel about the location of this and how re-transmission has technically not taken place yet

Copy link

github-actions bot commented Feb 6, 2025

PR #37439: Size comparison from a38f2aa to 1942b8c

Full report (3 builds for cc32xx, stm32)
platform target config section a38f2aa 1942b8c change % change
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 538621 538805 184 0.0
RAM 205208 205208 0 0.0
lock CC3235SF_LAUNCHXL FLASH 572493 572677 184 0.0
RAM 205360 205360 0 0.0
stm32 light STM32WB5MM-DK FLASH 482872 483056 184 0.0
RAM 144688 144688 0 0.0

Copy link

github-actions bot commented Feb 6, 2025

PR #37439: Size comparison from a38f2aa to 2c393c9

Full report (64 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, psoc6, qpg, stm32, telink, tizen)
platform target config section a38f2aa 2c393c9 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1094024 1094196 172 0.0
RAM 103314 103314 0 0.0
bl702 lighting-app bl702+eth FLASH 650542 650714 172 0.0
RAM 25265 25265 0 0.0
bl702+wifi FLASH 828506 828678 172 0.0
RAM 13981 13981 0 0.0
bl706+mfd+rpc+littlefs FLASH 1057066 1057238 172 0.0
RAM 23861 23861 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 888444 888616 172 0.0
RAM 18504 18504 0 0.0
lighting-app bl702l+mfd+littlefs FLASH 971486 971658 172 0.0
RAM 16368 16368 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 838240 838392 152 0.0
RAM 123480 123480 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 823644 823796 152 0.0
RAM 125360 125360 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 770820 771004 184 0.0
RAM 113820 113820 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 755088 755272 184 0.0
RAM 114028 114028 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 538621 538805 184 0.0
RAM 205208 205208 0 0.0
lock CC3235SF_LAUNCHXL FLASH 572493 572677 184 0.0
RAM 205360 205360 0 0.0
cyw30739 light CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 679585 679769 184 0.0
RAM 78548 78548 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 699429 699613 184 0.0
RAM 81188 81188 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 699429 699613 184 0.0
RAM 81188 81188 0 0.0
CYW930739M2EVB-02 unknown 2040 2040 0 0.0
FLASH 656365 656549 184 0.0
RAM 73616 73616 0 0.0
light-switch CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 615945 616129 184 0.0
RAM 71532 71532 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 635573 635757 184 0.0
RAM 74076 74076 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 635573 635757 184 0.0
RAM 74076 74076 0 0.0
lock CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 635449 635633 184 0.0
RAM 74540 74540 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 655157 655341 184 0.0
RAM 77084 77084 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 655157 655341 184 0.0
RAM 77084 77084 0 0.0
thermostat CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 611861 612045 184 0.0
RAM 68628 68628 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 631721 631905 184 0.0
RAM 71268 71268 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 631721 631905 184 0.0
RAM 71268 71268 0 0.0
efr32 lock-app BRD4187C FLASH 936408 936600 192 0.0
RAM 159872 159872 0 0.0
BRD4338a FLASH 730348 730556 208 0.0
RAM 234716 234716 0 0.0
window-app BRD4187C FLASH 1029656 1029848 192 0.0
RAM 128008 128008 0 0.0
esp32 all-clusters-app c3devkit DRAM 97312 97312 0 0.0
FLASH 1577420 1577596 176 0.0
IRAM 83820 83820 0 0.0
m5stack DRAM 116100 116100 0 0.0
FLASH 1545326 1545522 196 0.0
IRAM 117039 117039 0 0.0
linux air-purifier-app debug unknown 4760 4760 0 0.0
FLASH 2709171 2709703 532 0.0
RAM 132784 132784 0 0.0
all-clusters-app debug unknown 5568 5568 0 0.0
FLASH 5975584 5976116 532 0.0
RAM 531600 531632 32 0.0
all-clusters-minimal-app debug unknown 5464 5464 0 0.0
FLASH 5323948 5324480 532 0.0
RAM 242712 242744 32 0.0
bridge-app debug unknown 5480 5480 0 0.0
FLASH 4682560 4683092 532 0.0
RAM 221448 221480 32 0.0
chip-tool debug unknown 6120 6120 0 0.0
FLASH 13099268 13099800 532 0.0
RAM 596578 596578 0 0.0
chip-tool-ipv6only arm64 unknown 21816 21816 0 0.0
FLASH 11162800 11163152 352 0.0
RAM 648256 648256 0 0.0
fabric-admin debug unknown 5808 5808 0 0.0
FLASH 11388297 11388829 532 0.0
RAM 596362 596362 0 0.0
fabric-bridge-app debug unknown 4736 4736 0 0.0
FLASH 4507818 4508350 532 0.0
RAM 208632 208632 0 0.0
fabric-sync debug unknown 4976 4976 0 0.0
FLASH 5614085 5614613 528 0.0
RAM 483504 483504 0 0.0
lighting-app debug+rpc+ui unknown 6144 6144 0 0.0
FLASH 5625217 5625745 528 0.0
RAM 231728 231728 0 0.0
lock-app debug unknown 5416 5416 0 0.0
FLASH 4731186 4731718 532 0.0
RAM 207696 207728 32 0.0
ota-provider-app debug unknown 4776 4776 0 0.0
FLASH 4360136 4360668 532 0.0
RAM 201336 201336 0 0.0
ota-requestor-app debug unknown 4728 4728 0 0.0
FLASH 4497640 4498172 532 0.0
RAM 205920 205920 0 0.0
shell debug unknown 4256 4256 0 0.0
FLASH 3005709 3006237 528 0.0
RAM 160472 160504 32 0.0
thermostat-no-ble arm64 unknown 9512 9512 0 0.0
FLASH 4097192 4097544 352 0.0
RAM 246024 246040 16 0.0
tv-app debug unknown 5744 5744 0 0.0
FLASH 5952965 5953509 544 0.0
RAM 606904 606936 32 0.0
tv-casting-app debug unknown 5320 5320 0 0.0
FLASH 11272797 11273341 544 0.0
RAM 710864 710864 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1646740 1646948 208 0.0
RAM 211576 211576 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1553628 1553836 208 0.0
RAM 208392 208392 0 0.0
light cy8ckit_062s2_43012 FLASH 1469356 1469564 208 0.0
RAM 200368 200368 0 0.0
lock cy8ckit_062s2_43012 FLASH 1467308 1467516 208 0.0
RAM 224704 224704 0 0.0
qpg lighting-app qpg6105+debug FLASH 662216 662400 184 0.0
RAM 105220 105220 0 0.0
lock-app qpg6105+debug FLASH 619996 620188 192 0.0
RAM 99664 99664 0 0.0
stm32 light STM32WB5MM-DK FLASH 482872 483056 184 0.0
RAM 144688 144688 0 0.0
telink bridge-app tl7218x FLASH 665258 665434 176 0.0
RAM 90828 90828 0 0.0
contact-sensor-app tlsr9528a_retention FLASH 622020 622190 170 0.0
RAM 31500 31508 8 0.0
light-app-ota-shell-factory-data tl3218x FLASH 770804 770936 132 0.0
RAM 43568 43576 8 0.0
tl7218x FLASH 779306 779482 176 0.0
RAM 98704 98704 0 0.0
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 680618 680794 176 0.0
RAM 52192 52192 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 709172 709348 176 0.0
RAM 73400 73400 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 626108 626284 176 0.0
RAM 142032 142032 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 813492 813668 176 0.0
RAM 99576 99576 0 0.0
tizen all-clusters-app arm unknown 5104 5104 0 0.0
FLASH 1752232 1752592 360 0.0
RAM 93508 93508 0 0.0
chip-tool-ubsan arm unknown 11396 11396 0 0.0
FLASH 18696694 18699118 2424 0.0
RAM 8182536 8183676 1140 0.0

// reason, so saying we have sent re-transmit here is a little presumptuous.
if (mAnalyticsDelegate)
{
ReliableMessageAnalyticsDelegate::TransmitEvent event = {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO needs to move outside of CHIP_PROGRESS_LOGGING

@@ -155,6 +155,17 @@ void ReliableMessageMgr::ExecuteActions()
Transport::GetSessionTypeString(session), fabricIndex, ChipLogValueX64(destination),
CHIP_CONFIG_RMP_DEFAULT_MAX_RETRANS);

if (mAnalyticsDelegate)
{
ReliableMessageAnalyticsDelegate::TransmitEvent event = { .nodeId = destination,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO needs to move outside of CHIP_PROGRESS_LOGGING

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants