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

Framework for emitting metrics data #32223

Merged

Conversation

anush-apple
Copy link
Contributor

Change Overview:

  • Added mechanism to log simple metric data. Metric encapsulated by object to allow future additions.
  • Metrics will be noop on platforms that don't enable the feature
  • Switched the existing MATTER_TRACE_METRIC to the new metric macro MATTER_LOG_METRIC to match data logging patterns with other MATTER_LOG_XYZ formats
  • Added sample metrics data in CHIPDeviceController::EstablishPASEConnection as a starter

Testing###

  • Verified metrics emitted using darwin-framework-tool
  • Verified compilation for ESP32 and tv-casting-app compilation with the new changes

@anush-apple anush-apple force-pushed the anush-apple/darwin-tracing-signpost branch from 04514d7 to 7c0c093 Compare February 24, 2024 09:25
Copy link

github-actions bot commented Feb 24, 2024

PR #32223: Size comparison from c5a0720 to 7c0c093

Increases above 0.2%:

platform target config section c5a0720 7c0c093e change % change
linux all-clusters-app debug .rodata 348432 349232 800 0.2
all-clusters-minimal-app debug .rodata 287458 288258 800 0.3
bridge-app debug (read only) 4582785 4592481 9696 0.2
.rodata 228066 228898 832 0.4
.text 4134643 4143507 8864 0.2
lighting-app debug+rpc+ui .rodata 352884 353716 832 0.2
lock-app debug (read only) 4650513 4660209 9696 0.2
.rodata 254082 254914 832 0.3
.text 4184995 4193859 8864 0.2
ota-provider-app debug (read only) 4278329 4292041 13712 0.3
.rodata 206786 207458 672 0.3
.text 3878787 3891827 13040 0.3
ota-requestor-app debug (read only) 4404297 4418057 13760 0.3
.rodata 212898 213602 704 0.3
.text 3994099 4007155 13056 0.3
tv-app debug .rodata 287074 287906 832 0.3
tv-casting-app debug .rodata 381776 382608 832 0.2
Increases (11 builds for linux)
platform target config section c5a0720 7c0c093e change % change
linux all-clusters-app debug (read only) 5905321 5914969 9648 0.2
.rodata 348432 349232 800 0.2
.text 5123779 5132627 8848 0.2
all-clusters-minimal-app debug (read only) 5185905 5195569 9664 0.2
.rodata 287458 288258 800 0.3
.text 4663955 4672819 8864 0.2
bridge-app debug (read only) 4582785 4592481 9696 0.2
.rodata 228066 228898 832 0.4
.text 4134643 4143507 8864 0.2
chip-tool debug (read only) 11997241 12011113 13872 0.1
.rodata 447257 448089 832 0.2
.text 10844451 10857491 13040 0.1
lighting-app debug+rpc+ui (read only) 5505073 5514769 9696 0.2
.rodata 352884 353716 832 0.2
.text 4906035 4914899 8864 0.2
lock-app debug (read only) 4650513 4660209 9696 0.2
.rodata 254082 254914 832 0.3
.text 4184995 4193859 8864 0.2
ota-provider-app debug (read only) 4278329 4292041 13712 0.3
.rodata 206786 207458 672 0.3
.text 3878787 3891827 13040 0.3
ota-requestor-app debug (read only) 4404297 4418057 13760 0.3
.rodata 212898 213602 704 0.3
.text 3994099 4007155 13056 0.3
shell debug (read only) 2885049 2885177 128 0.0
.rodata 184992 185120 128 0.1
tv-app debug (read only) 5660113 5669793 9680 0.2
.rodata 287074 287906 832 0.3
.text 5131315 5140163 8848 0.2
tv-casting-app debug (read only) 9848033 9857713 9680 0.1
.rodata 381776 382608 832 0.2
.text 9000755 9009603 8848 0.1
Decreases (3 builds for efr32)
platform target config section c5a0720 7c0c093e change % change
efr32 lighting-app BRD4161A+rs9116 (read/write) 930712 930704 -8 -0.0
.text 731388 731380 -8 -0.0
lock-app BRD4161A+wf200 (read/write) 1121500 1121492 -8 -0.0
.text 931924 931916 -8 -0.0
window-app BRD4187C (read/write) 1154864 1154856 -8 -0.0
.text 984132 984124 -8 -0.0
Full report (71 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, stm32, telink)
platform target config section c5a0720 7c0c093e change % change
bl602 lighting-app bl602 (read/write) 1433758 1433758 0 0.0
.bss 85328 85328 0 0.0
.data 9496 9496 0 0.0
.rodata 157528 157528 0 0.0
.text 1100754 1100754 0 0.0
bl602+mfd (read/write) 1448158 1448158 0 0.0
.bss 85488 85488 0 0.0
.data 9472 9472 0 0.0
.rodata 156488 156488 0 0.0
.text 1116068 1116068 0 0.0
bl602+rpc (read/write) 1481406 1481406 0 0.0
.bss 93360 93360 0 0.0
.data 9880 9880 0 0.0
.rodata 165104 165104 0 0.0
.text 1132400 1132400 0 0.0
bl702 lighting-app bl702 (read only) 3478 3478 0 0.0
(read/write) 1198763 1198763 0 0.0
.bss 11117 11117 0 0.0
.data 3680 3680 0 0.0
.rodata 106872 106872 0 0.0
.text 970228 970228 0 0.0
bl702+mfd (read only) 3478 3478 0 0.0
(read/write) 1209563 1209563 0 0.0
.bss 11293 11293 0 0.0
.data 3656 3656 0 0.0
.rodata 105812 105812 0 0.0
.text 981982 981982 0 0.0
bl702+rpc (read only) 3478 3478 0 0.0
(read/write) 1290491 1290491 0 0.0
.bss 19581 19581 0 0.0
.data 4224 4224 0 0.0
.rodata 122244 122244 0 0.0
.text 1045180 1045180 0 0.0
bl706-eth (read/write) 1016365 1016365 0 0.0
.bss 23692 23692 0 0.0
.data 3256 3256 0 0.0
.rodata 100216 100216 0 0.0
.text 761230 761230 0 0.0
bl706-wifi (read/write) 1250294 1250294 0 0.0
.bss 10561 10561 0 0.0
.data 3696 3696 0 0.0
.rodata 121216 121216 0 0.0
.text 992416 992416 0 0.0
bl702l lighting-app bl702l (read only) 512 512 0 0.0
(read/write) 1168112 1168112 0 0.0
.bss 16312 16312 0 0.0
.data 5040 5040 0 0.0
.rodata 100876 100876 0 0.0
.text 963098 963098 0 0.0
bl702l+mfd (read only) 512 512 0 0.0
(read/write) 1179516 1179516 0 0.0
.bss 16488 16488 0 0.0
.data 5024 5024 0 0.0
.rodata 99816 99816 0 0.0
.text 975420 975420 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 (read only) 772620 772620 0 0.0
(read/write) 168600 168600 0 0.0
.bss 90604 90604 0 0.0
.data 3560 3560 0 0.0
.rodata 81644 81644 0 0.0
.text 690712 690712 0 0.0
lock-ftd LP_EM_CC1354P10_6 (read only) 789252 789252 0 0.0
(read/write) 178848 178848 0 0.0
.bss 100852 100852 0 0.0
.data 3560 3560 0 0.0
.rodata 75940 75940 0 0.0
.text 713048 713048 0 0.0
lock-mtd LP_EM_CC1354P10_6 (read only) 777892 777892 0 0.0
(read/write) 173288 173288 0 0.0
.bss 95292 95292 0 0.0
.data 3560 3560 0 0.0
.rodata 102692 102692 0 0.0
.text 674936 674936 0 0.0
pump-app LP_EM_CC1354P10_6 (read only) 730076 730076 0 0.0
(read/write) 167568 167568 0 0.0
.bss 89336 89336 0 0.0
.data 3552 3552 0 0.0
.rodata 77364 77364 0 0.0
.text 652448 652448 0 0.0
pump-controller-app LP_EM_CC1354P10_6 (read only) 715700 715700 0 0.0
(read/write) 167776 167776 0 0.0
.bss 89560 89560 0 0.0
.data 3544 3544 0 0.0
.rodata 73204 73204 0 0.0
.text 642232 642232 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL (read only) 581986 581986 0 0.0
(read/write) 207968 207968 0 0.0
.bss 201204 201204 0 0.0
.data 1640 1640 0 0.0
.rodata 86522 86522 0 0.0
.text 493340 493340 0 0.0
lock CC3235SF_LAUNCHXL (read only) 627346 627346 0 0.0
(read/write) 208312 208312 0 0.0
.bss 201696 201696 0 0.0
.data 1496 1496 0 0.0
.rodata 106978 106978 0 0.0
.text 518244 518244 0 0.0
cyw30739 light cyw930739m2evb_01 (read/write) 567843 567843 0 0.0
.app_xip_area 457621 457621 0 0.0
.bss 65056 65056 0 0.0
.data 744 744 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
lock cyw930739m2evb_01 (read/write) 550667 550667 0 0.0
.app_xip_area 435685 435685 0 0.0
.bss 69808 69808 0 0.0
.data 752 752 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
ota-requestor cyw930739m2evb_01 (read/write) 569451 569451 0 0.0
.app_xip_area 460733 460733 0 0.0
.bss 63592 63592 0 0.0
.data 704 704 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
switch cyw930739m2evb_01 (read/write) 564067 564067 0 0.0
.app_xip_area 452069 452069 0 0.0
.bss 66792 66792 0 0.0
.data 784 784 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4161A+rs9116 (read/write) 930712 930704 -8 -0.0
.bss 197912 197912 0 0.0
.data 1388 1388 0 0.0
.text 731388 731380 -8 -0.0
BRD4187C (read/write) 1108448 1108448 0 0.0
.bss 195152 195152 0 0.0
.data 3408 3408 0 0.0
.text 909868 909868 0 0.0
lock-app BRD4161A+wf200 (read/write) 1121500 1121492 -8 -0.0
.bss 186764 186764 0 0.0
.data 2792 2792 0 0.0
.text 931924 931916 -8 -0.0
window-app BRD4187C (read/write) 1154864 1154856 -8 -0.0
.bss 167392 167392 0 0.0
.data 3320 3320 0 0.0
.text 984132 984124 -8 -0.0
esp32 all-clusters-app c3devkit (read only) 1210254 1210254 0 0.0
(read/write) 1748656 1748656 0 0.0
.dram0.bss 74296 74296 0 0.0
.dram0.data 13620 13620 0 0.0
.flash.rodata 251200 251200 0 0.0
.flash.text 1210254 1210254 0 0.0
.iram0.text 75530 75530 0 0.0
m5stack (read only) 1252363 1252363 0 0.0
(read/write) 534148 534148 0 0.0
.dram0.bss 81208 81208 0 0.0
.dram0.data 35164 35164 0 0.0
.flash.rodata 281856 281856 0 0.0
.flash.text 1246199 1246199 0 0.0
.iram0.text 125403 125403 0 0.0
k32w contact k32w0+release (read only) 604912 604912 0 0.0
(read/write) 79608 79608 0 0.0
.bss 67428 67428 0 0.0
.data 2196 2196 0 0.0
.text 604376 604376 0 0.0
k32w1+release (read only) 1024 1024 0 0.0
(read/write) 747436 747436 0 0.0
.bss 79188 79188 0 0.0
.data 2816 2816 0 0.0
.text 626064 626064 0 0.0
light k32w0+release (read only) 608840 608840 0 0.0
(read/write) 79492 79492 0 0.0
.bss 67308 67308 0 0.0
.data 2200 2200 0 0.0
.text 608304 608304 0 0.0
k32w1+release (read only) 1024 1024 0 0.0
(read/write) 789208 789208 0 0.0
.bss 80580 80580 0 0.0
.data 2032 2032 0 0.0
.text 667240 667240 0 0.0
lock k32w0+release (read only) 588816 588816 0 0.0
(read/write) 77480 77480 0 0.0
.bss 65348 65348 0 0.0
.data 2148 2148 0 0.0
.text 588280 588280 0 0.0
linux air-purifier-app debug (read only) 2611013 2611013 0 0.0
(read/write) 128800 128800 0 0.0
.bss 46448 46448 0 0.0
.data 2240 2240 0 0.0
.data.rel.ro 74184 74184 0 0.0
.dynamic 608 608 0 0.0
.got 4544 4544 0 0.0
.init 27 27 0 0.0
.init_array 744 744 0 0.0
.rodata 184208 184208 0 0.0
.text 2249557 2249557 0 0.0
all-clusters-app debug (read only) 5905321 5914969 9648 0.2
(read/write) 480240 480240 0 0.0
.bss 134784 134784 0 0.0
.data 4496 4496 0 0.0
.data.rel.ro 333560 333560 0 0.0
.dynamic 624 624 0 0.0
.got 5360 5360 0 0.0
.init 27 27 0 0.0
.init_array 1384 1384 0 0.0
.rodata 348432 349232 800 0.2
.text 5123779 5132627 8848 0.2
all-clusters-minimal-app debug (read only) 5185905 5195569 9664 0.2
(read/write) 236192 236192 0 0.0
.bss 127584 127584 0 0.0
.data 4400 4400 0 0.0
.data.rel.ro 97160 97160 0 0.0
.dynamic 624 624 0 0.0
.got 5280 5280 0 0.0
.init 27 27 0 0.0
.init_array 1112 1112 0 0.0
.rodata 287458 288258 800 0.3
.text 4663955 4672819 8864 0.2
bridge-app debug (read only) 4582785 4592481 9696 0.2
(read/write) 217072 217072 0 0.0
.bss 118112 118112 0 0.0
.data 6176 6176 0 0.0
.data.rel.ro 86080 86080 0 0.0
.dynamic 624 624 0 0.0
.got 5248 5248 0 0.0
.init 27 27 0 0.0
.init_array 808 808 0 0.0
.rodata 228066 228898 832 0.4
.text 4134643 4143507 8864 0.2
chip-tool debug (read only) 11997241 12011113 13872 0.1
(read/write) 521352 521352 0 0.0
.bss 94392 94392 0 0.0
.data 5090 5090 0 0.0
.data.rel.ro 414656 414656 0 0.0
.dynamic 624 624 0 0.0
.got 5768 5768 0 0.0
.init 27 27 0 0.0
.init_array 776 776 0 0.0
.rodata 447257 448089 832 0.2
.text 10844451 10857491 13040 0.1
lighting-app debug+rpc+ui (read only) 5505073 5514769 9696 0.2
(read/write) 225832 225832 0 0.0
.bss 119048 119048 0 0.0
.data 4832 4832 0 0.0
.data.rel.ro 94480 94480 0 0.0
.dynamic 672 672 0 0.0
.got 5864 5864 0 0.0
.init 27 27 0 0.0
.init_array 920 920 0 0.0
.rodata 352884 353716 832 0.2
.text 4906035 4914899 8864 0.2
lock-app debug (read only) 4650513 4660209 9696 0.2
(read/write) 204688 204688 0 0.0
.bss 113536 113536 0 0.0
.data 4128 4128 0 0.0
.data.rel.ro 80328 80328 0 0.0
.dynamic 624 624 0 0.0
.got 5200 5200 0 0.0
.init 27 27 0 0.0
.init_array 840 840 0 0.0
.rodata 254082 254914 832 0.3
.text 4184995 4193859 8864 0.2
ota-provider-app debug (read only) 4278329 4292041 13712 0.3
(read/write) 193160 193160 0 0.0
.bss 113216 113216 0 0.0
.data 4336 4336 0 0.0
.data.rel.ro 69712 69712 0 0.0
.dynamic 624 624 0 0.0
.got 4536 4536 0 0.0
.init 27 27 0 0.0
.init_array 704 704 0 0.0
.rodata 206786 207458 672 0.3
.text 3878787 3891827 13040 0.3
ota-requestor-app debug (read only) 4404297 4418057 13760 0.3
(read/write) 197560 197560 0 0.0
.bss 114112 114112 0 0.0
.data 4736 4736 0 0.0
.data.rel.ro 72832 72832 0 0.0
.dynamic 624 624 0 0.0
.got 4472 4472 0 0.0
.init 27 27 0 0.0
.init_array 752 752 0 0.0
.rodata 212898 213602 704 0.3
.text 3994099 4007155 13056 0.3
shell debug (read only) 2885049 2885177 128 0.0
(read/write) 156224 156224 0 0.0
.bss 62672 62672 0 0.0
.data 1392 1392 0 0.0
.data.rel.ro 86384 86384 0 0.0
.dynamic 592 592 0 0.0
.got 4072 4072 0 0.0
.init 27 27 0 0.0
.init_array 1064 1064 0 0.0
.rodata 184992 185120 128 0.1
.text 2526930 2526930 0 0.0
tv-app debug (read only) 5660113 5669793 9680 0.2
(read/write) 351400 351400 0 0.0
.bss 243344 243344 0 0.0
.data 6496 6496 0 0.0
.data.rel.ro 94296 94296 0 0.0
.dynamic 624 624 0 0.0
.got 5496 5496 0 0.0
.init 27 27 0 0.0
.init_array 1136 1136 0 0.0
.rodata 287074 287906 832 0.3
.text 5131315 5140163 8848 0.2
tv-casting-app debug (read only) 9848033 9857713 9680 0.1
(read/write) 340064 340064 0 0.0
.bss 156112 156112 0 0.0
.data 2944 2944 0 0.0
.data.rel.ro 174136 174136 0 0.0
.dynamic 624 624 0 0.0
.got 5072 5072 0 0.0
.init 27 27 0 0.0
.init_array 1160 1160 0 0.0
.rodata 381776 382608 832 0.2
.text 9000755 9009603 8848 0.1
mbed lock-app-release cy8cproto_062_4343w (read only) 6224 6224 0 0.0
(read/write) 2531528 2531528 0 0.0
.bss 220448 220448 0 0.0
.data 5200 5200 0 0.0
.text 1494212 1494212 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read only) 4 4 0 0.0
(read/write) 1101296 1101296 0 0.0
bss 130831 130831 0 0.0
rodata 112024 112024 0 0.0
text 810588 810588 0 0.0
nrf7002dk_nrf5340_cpuapp (read only) 4 4 0 0.0
(read/write) 1221320 1221320 0 0.0
bss 122921 122921 0 0.0
rodata 141768 141768 0 0.0
text 806112 806112 0 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 (read only) 4 4 0 0.0
(read/write) 1049284 1049284 0 0.0
bss 129689 129689 0 0.0
rodata 99396 99396 0 0.0
text 772368 772368 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 (read only) 834464 834464 0 0.0
(read/write) 1795188 1795188 0 0.0
.bss 196212 196212 0 0.0
.data 2664 2664 0 0.0
.text 1587924 1587924 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 (read only) 837616 837616 0 0.0
(read/write) 1717300 1717300 0 0.0
.bss 193092 193092 0 0.0
.data 2632 2632 0 0.0
.text 1513188 1513188 0 0.0
light cy8ckit_062s2_43012 (read only) 844344 844344 0 0.0
(read/write) 1636420 1636420 0 0.0
.bss 186556 186556 0 0.0
.data 2440 2440 0 0.0
.text 1439036 1439036 0 0.0
lock cy8ckit_062s2_43012 (read only) 817184 817184 0 0.0
(read/write) 1666332 1666332 0 0.0
.bss 213716 213716 0 0.0
.data 2440 2440 0 0.0
.text 1441788 1441788 0 0.0
qpg lighting-app qpg6105+debug (read/write) 1127704 1127704 0 0.0
.bss 102456 102456 0 0.0
.data 820 820 0 0.0
.text 640088 640088 0 0.0
lock-app qpg6105+debug (read/write) 1087664 1087664 0 0.0
.bss 97200 97200 0 0.0
.data 840 840 0 0.0
.text 600044 600044 0 0.0
stm32 light STM32WB5MM-DK (read/write) 599149 599149 0 0.0
.bss 128320 128320 0 0.0
.data 668 668 0 0.0
.rodata 78772 78772 0 0.0
.text 381664 381664 0 0.0
telink air-quality-sensor-app tlsr9528a_retention (read only) 51774 51774 0 0.0
(read/write) 821962 821962 0 0.0
bss 49660 49660 0 0.0
text 615766 615766 0 0.0
all-clusters-app tlsr9518adk80d (read only) 29042 29042 0 0.0
(read/write) 1090780 1090780 0 0.0
bss 101780 101780 0 0.0
text 792878 792878 0 0.0
all-clusters-minimal-app tlsr9528a (read only) 47960 47960 0 0.0
(read/write) 1048268 1048268 0 0.0
bss 110084 110084 0 0.0
text 764222 764222 0 0.0
bridge-app tlsr9518adk80d (read only) 29042 29042 0 0.0
(read/write) 909020 909020 0 0.0
bss 93116 93116 0 0.0
text 651688 651688 0 0.0
contact-sensor-app tlsr9528a_retention (read only) 51774 51774 0 0.0
(read/write) 823642 823642 0 0.0
bss 49708 49708 0 0.0
text 617504 617504 0 0.0
light-switch-app-ota-shell-factory-data tlsr9528a (read only) 51584 51584 0 0.0
(read/write) 929384 929384 0 0.0
bss 77708 77708 0 0.0
text 697680 697680 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d (read only) 29122 29122 0 0.0
(read/write) 1071652 1071652 0 0.0
bss 100196 100196 0 0.0
text 776562 776562 0 0.0
lock-app-dfu tlsr9528a (read only) 51584 51584 0 0.0
(read/write) 901720 901720 0 0.0
bss 69172 69172 0 0.0
text 652884 652884 0 0.0
ota-requestor-app tlsr9518adk80d (read only) 29042 29042 0 0.0
(read/write) 927508 927508 0 0.0
bss 92696 92696 0 0.0
text 670210 670210 0 0.0
pump-app tlsr9258a_retention (read only) 51774 51774 0 0.0
(read/write) 826194 826194 0 0.0
bss 49816 49816 0 0.0
text 620460 620460 0 0.0
pump-controller-app tlsr9518adk80d (read only) 31872 31872 0 0.0
(read/write) 789908 789908 0 0.0
bss 56016 56016 0 0.0
text 591210 591210 0 0.0
shell tlsr9518adk80d (read only) 29042 29042 0 0.0
(read/write) 676816 676816 0 0.0
bss 73672 73672 0 0.0
text 462298 462298 0 0.0
smoke_co_alarm-app tlsr9528a_retention (read only) 51774 51774 0 0.0
(read/write) 830678 830678 0 0.0
bss 51340 51340 0 0.0
text 623574 623574 0 0.0
temperature-measurement-app-mars-ota tlsr9518adk80d (read only) 32220 32220 0 0.0
(read/write) 849221 849221 0 0.0
bss 59492 59492 0 0.0
text 635268 635268 0 0.0
thermostat tlsr9518adk80d (read only) 31872 31872 0 0.0
(read/write) 815576 815576 0 0.0
bss 56304 56304 0 0.0
text 610918 610918 0 0.0
window-covering tlsr9258a (read only) 51584 51584 0 0.0
(read/write) 833680 833680 0 0.0
bss 68080 68080 0 0.0
text 626174 626174 0 0.0

@woody-apple
Copy link
Contributor

Pinging @andy31415 and @tcarmelveilleux to confirm all these are resolved.

@mergify mergify bot merged commit 8f2a4d2 into project-chip:master Feb 25, 2024
58 checks passed
@anush-apple anush-apple deleted the anush-apple/darwin-tracing-signpost branch February 26, 2024 23:22
huangxuyong pushed a commit to huangxuyong/connectedhomeip that referenced this pull request Mar 19, 2024
* Rerouted tracing macros to Darwin signposts

* Initial framework for logging scalar data event

* Handled the new metrics event changes in collector

* Modified VerifyOrExit macro to accept an optional metric key as third argument

* Removed direct use of chrono in metrics_event.h
Switched MTRMetrics to vend dictionary for metric keys

* Modified SuccessOrExit to optionally accept metric key

* Moved metric keys to separate header
Reworked metric_event names for more clarity

* Switched MATTER_TRACE_METRIC usage to MATTER_LOG_METRIC

* Restyle fixes

* Fixed unit tests

* Fixed build failure due to MetricEvent hidden inside tracing enabled

* Fixing one source of build error

* Fixing darwin build failure

* Code Review: Rename LogMetric to LogMetricEvent

* Code Review Suggestions:

1. Metric Macros take full string constants and no longer use
   preprocessor to prefix. Allows free flowing strings
2. Reworked MetricEvent class and documented
3. Handled LogEventMetric for Darwin, ESP32, Perfetto, JSON to account
   for all types
4. Removed timePoint from MetricEvent class. Timestamps and duration
   calculation is now responsibility for the handlers of the event
5. Reverted BUILD.gn in system to not break out SystemClock.h

* Code Review Feedback project-chip#2:

1. Added SuccessOrExitWithMetric and VerifyOrExitWithMetric
2. Cleaned up support .gn to remove dependedency on metrics

* Code Review Feedback project-chip#3:

1. Added ScopedMetricEvent to use RAII to track begin and end within a
   scope

* Code Review project-chip#4:

Reverted an accidental removal

* Added MTRMetricData to description as per review comment

* Restyler fixes

* Sample code of how Begin and End log metrics can be used

* Fixed compilation error when tracing is disabled

* Fixes for build failures when tracing is disabled

* Picked up code review suggestion accidently dropped

* Code Review Feedback:

1. Begin metric does not take value
2. Allow undefined value for metric
3. Misc other feedback

* Handle undefined value and error value

* Revert a comment change

* Review Feedback: Changed ScopedMetricEvent to capture error by reference

* Fixed another build failure

* Reverting usage of LOG_METRICS

* Review feedback: Fix incorrect documentation

* Code Review Feedback: Remove access to Value in MetricEvent to avoid incorrect access

* Restyler fixes

* Unregistering backend in Darwin shutdown

* Resytler fixes...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

6 participants