aboutsummaryrefslogtreecommitdiff
path: root/src/utils/thread_helper.hpp
diff options
context:
space:
mode:
authorTony Zhou <66936782+morningboata@users.noreply.github.com>2023-11-03 11:59:58 +0800
committerGitHub <noreply@github.com>2023-11-02 20:59:58 -0700
commit45c857c46a333dc97f7a49d74e7807ef30f880cd (patch)
treeed62be755c4357e1b6b3867acfe7341fc0144476 /src/utils/thread_helper.hpp
parent7df21bdc93de1a057d86fd96c2b35c65842168b4 (diff)
downloadot-br-posix-45c857c46a333dc97f7a49d74e7807ef30f880cd.tar.gz
[thread] refine `RetrieveTelemetryData` to populate metrics with best effort (#2076)
Best effort means, for a given telemetry, if its retrieval has error, it is left unpopulated and the process continues to retrieve the remaining telemetries instead of the immediately return. The error code OT_ERRROR_FAILED will be returned if there is one or more error(s) happened in the process. This change helps to retrieve telemetries with best effort when needed.
Diffstat (limited to 'src/utils/thread_helper.hpp')
-rw-r--r--src/utils/thread_helper.hpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/utils/thread_helper.hpp b/src/utils/thread_helper.hpp
index 10d38770..b566e663 100644
--- a/src/utils/thread_helper.hpp
+++ b/src/utils/thread_helper.hpp
@@ -258,12 +258,16 @@ public:
#if OTBR_ENABLE_TELEMETRY_DATA_API
/**
- * This method populates the telemetry data and returns the error code if error happens.
+ * This method populates the telemetry data with best effort. The best effort means, for a given
+ * telemetry, if its retrieval has error, it is left unpopulated and the process continues to
+ * retrieve the remaining telemetries instead of the immediately return. The error code
+ * OT_ERRROR_FAILED will be returned if there is one or more error(s) happened in the process.
*
* @param[in] aPublisher The Mdns::Publisher to provide MDNS telemetry if it is not `nullptr`.
* @param[in] telemetryData The telemetry data to be populated.
*
- * @returns The error code if error happens during the population of the telemetry data.
+ * @retval OTBR_ERROR_NONE There is no error happened in the process.
+ * @retval OT_ERRROR_FAILED There is one or more error(s) happened in the process.
*/
otError RetrieveTelemetryData(Mdns::Publisher *aPublisher, threadnetwork::TelemetryData &telemetryData);
#endif // OTBR_ENABLE_TELEMETRY_DATA_API