-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Add metrics for OTA transfers #39991
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces metrics for OTA transfers. It adds a new categorization system for metrics to separate OTA metrics from existing commissioning metrics. The changes include new APIs for metrics collection, logging OTA-related data, and a new test to verify the functionality. The review focuses on a potential breaking API change in the metrics collector, code duplication, and adherence to Objective-C coding idioms.
PR #39991: Size comparison from ad2e3f5 to abdc57c Full report (59 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
@@ -477,6 +480,8 @@ MTR_EXTERN NSString * const MTRDataVersionKey MTR_AVAILABLE(ios(17.6), macos(14. | |||
*/ | |||
- (void)deviceConfigurationChanged:(MTRDevice *)device MTR_AVAILABLE(ios(17.6), macos(14.6), watchos(10.6), tvos(17.6)); | |||
|
|||
- (void)otaTransferEnded:(MTRDevice *)device metrics:(MTRMetrics *)metrics; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Though I wonder whether we should communicate the metrics to the actual "transfer ended" callback... but that might be hard due to the API changes needed, I guess.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure which callback you're talking about here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving pending resolved comments (internal headers)
src/darwin/Framework/CHIPTests/TestHelpers/MTRDeviceTestDelegate.m
Outdated
Show resolved
Hide resolved
constexpr Tracing::MetricKey kMetricOTADeviceVendorID = NOT_COMMISSIONING_METRICS_KEY(ota, device_vendor_id); | ||
|
||
// Device Product ID | ||
constexpr Tracing::MetricKey kMetricOTADeviceProductID = NOT_COMMISSIONING_METRICS_KEY(ota, device_product_id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a thought: Is there a better way to have product and vendor ID that is the same key for all categories ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue is the filtering, we could special-case vendor and product id and never filter them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But even with filtering the issue is that if we have values for different categories that use the same key, then we might be deleting those for all categories as soon as we submit one of the categories.
Co-authored-by: Boris Zbarsky <bzbarsky@apple.com>
5ab4e94
to
ae331e9
Compare
Summary
This adds metrics for OTA BDX transfers, recording vendor id, product id, whether the device is on a Thread network, the offset and number of bytes processed and the duration of the transfer.
Because the metrics infrastructure was only used for commissioning before, I tried adding support for encoding categories in the existing key/value system. I also think we don't have good support for recording metrics during simultaneous transfers to different devices. That would require a bit of a redesign of the metrics system.
Testing
I added a new test that verifies that metrics are recorded. Unfortunately the OTA tests that do an actual transfer are all disabled in automation, because they used to timeout. I did verify locally that the test passes.
Readability checklist
The checklist below will help the reviewer finish PR review in time and keep the
code readable:
descriptive
“When in Rome…”
rule (coding style)
See: Pull Request Guidelines