-
Notifications
You must be signed in to change notification settings - Fork 76
Add IoT Metrics Support #809
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: main
Are you sure you want to change the base?
Conversation
…into iot_metrics
This reverts commit 4bf6518.
| * Enable AWS IoT metrics, if not set, default to enabled. | ||
| * | ||
| * @param enabled enable AWS IoT metrics to collect SDK usage data | ||
| * @return The ConnectPacket Object after setting the user property |
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.
Should be @return this option object or something similar
| const Crt::Io::SocketOptions &socketOptions, | ||
| Crt::Io::TlsContext &&tlsContext); | ||
| Crt::Io::TlsContext &&tlsContext, | ||
| bool enableMetrics); |
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.
Default value for a new argument should be specified here rather than in cpp. The same applies to other methods.
| m_connackTimeoutMs(0), m_ackTimeoutSec(0), m_allocator(allocator) | ||
| m_connackTimeoutMs(0), m_ackTimeoutSec(0), m_enableMetrics(true), m_allocator(allocator) | ||
| { | ||
| m_sdkMetrics = Mqtt::IoTDeviceSDKMetrics(); |
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.
nit: m_sdkMetrics is already default constructed at this point, so this line can be safely removed.
|
|
||
| if (m_enableMetrics) | ||
| { | ||
| struct aws_mqtt_iot_sdk_metrics 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.
metrics should be zeroed. Otherwise we can get uninitialized fields here on adding meta data in aws-c-mqtt.
| /** Enable AWS IoT Metrics Collection. This is always set to true for now. */ | ||
| bool m_enableMetricsCollection; | ||
|
|
||
| Crt::String m_sdkName = "CPPv2"; | ||
| Crt::String m_sdkVersion = AWS_CRT_CPP_VERSION; |
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.
Shouldn't we remove this? I think struct IoTDeviceSDKMetrics handles the metrics now.
Issue #, if available:
Description of changes:
IoTDeviceSDKMetricsand metrics related features , CRT is now appending AWS metrics by default.enableMetricsoption to allow user disable metrics.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.