-
Notifications
You must be signed in to change notification settings - Fork 110
Device Defender custom metrics support #401
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
Conversation
Got the initial, proof-of-concept solution for passing a custom metric function to device defender from C++. Rough around the edges currently and only supports number functions, but it compiles and seems to work in the test! Need to verify results but committing to ensure changes are saved.
…e function pointer
… into DeviceDefenderCustomMetricsSupport
…ocation, and updated sample and tests
…om/aws/aws-iot-device-sdk-cpp-v2 into DeviceDefenderCustomMetricsSupport
… into DeviceDefenderCustomMetricsSupport
Note: This PR relies on the changes in awslabs/aws-c-iot#67 in order to compile successfully, since it adds some new functions for custom metrics using doubles. |
…or custom metrics. Currently custom numbers, number lists, and the tests for numbers work. Custom strings and IP cause segfault currently
…om/aws/aws-iot-device-sdk-cpp-v2 into DeviceDefenderCustomMetricsSupport
I pushed the first part of the changes based on the code review, but I have not fully implemented it just yet. Currently custom metrics for strings and IP lists are not working, causing segmentation faults when they are written to JSON. I think it is the strings are going out of reference. |
…her than reference and that was causing the crash
…om/aws/aws-iot-device-sdk-cpp-v2 into DeviceDefenderCustomMetricsSupport
…get CPU, memory, and process usage
… into DeviceDefenderCustomMetricsSupport
… into DeviceDefenderCustomMetricsSupport
…onnection builder in sample
…om register functions to be passed by value
Thanks for the reviews! Merging into |
Description of changes:
Adds support for registering custom metrics to the Device Defender service. Exposes functions to hook into Device Defender number, number-list, string-list, and ip-list metric gathering. Adds new functions to
Aws::Iotdevicedefenderv1
to register these custom metrics either by passing a function pointer or astd::function
. Adds predefined custom metric functions that will get CPU usage (in percent), memory usage (in kilobytes) and process count.This PR also adds a device defender sample to show how to use and register custom metrics and custom metrics tests to the existing Device Defender tests.
aws-c-iot
PR that accompanies this PR: awslabs/aws-c-iot#67By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.