-
Notifications
You must be signed in to change notification settings - Fork 484
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
Get Bulk Stats API #1352
Get Bulk Stats API #1352
Conversation
This API introduces ability to query bulk stats for an object list. Return counter buffer is populated in the same order as the counter id for each object in a list. Since same counter ids are applicable to all objects in the list, objects need to be of the same type. Signed-off-by: Jai Kumar <jai.kumar@broadcom.com>
Signed-off-by: Jai Kumar <jai.kumar@broadcom.com>
Signed-off-by: Jai Kumar <jai.kumar@broadcom.com>
Signed-off-by: Jai Kumar <jai.kumar@broadcom.com>
We should extend sai_query_stats_capability() to return if bulk get stats is supported for a given object type.
|
2 asks:
|
Signed-off-by: Jai Kumar <jai.kumar@broadcom.com>
Added the capability flags |
Taken care of both review comments |
@gechiang @rck-innovium @marian-pritsak @mikeberesford |
Signed-off-by: Jai Kumar <jai.kumar@broadcom.com>
Signed-off-by: Jai Kumar <jai.kumar@broadcom.com>
Signed-off-by: Jai Kumar <jai.kumar@broadcom.com>
+1 |
@kcudnik Please re-review |
Signed-off-by: Jai Kumar <jai.kumar@broadcom.com>
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.
LGTM.
Return data is used as a pointer to the chunk of buffer.
From: Kamil Cudnik ***@***.***>
Reply-To: opencomputeproject/SAI ***@***.***>
Date: Monday, January 10, 2022 at 8:36 AM
To: opencomputeproject/SAI ***@***.***>
Cc: Jai Kumar ***@***.***>, Mention ***@***.***>
Subject: Re: [opencomputeproject/SAI] Get Bulk Stats API (PR #1352)
@kcudnik commented on this pull request.
________________________________
In inc/saiobject.h<#1352 (comment)>:
+ * @param[in] mode Statistics mode
+ * @param[inout] object_statuses Array of status for each object. Length of the array should be object_count. Should be looked only if API return is not SAI_STATUS_SUCCESS.
+ * @param[out] counters Array of resulting counter values.
+ *
+ * @return #SAI_STATUS_SUCCESS on success, failure status code on error
+ */
+typedef sai_status_t (*sai_bulk_object_get_stats_fn)(
+ _In_ sai_object_id_t switch_id,
+ _In_ sai_object_type_t object_type,
+ _In_ uint32_t object_count,
+ _In_ const sai_object_key_t *object_key,
+ _In_ uint32_t number_of_counters,
+ _In_ const sai_stat_id_t *counter_ids,
+ _In_ sai_stats_mode_t mode,
+ _Inout_ sai_status_t *object_statuses,
+ _Out_ uint64_t *counters);
i think in all other places apis like that, when multiple objects are used, then array of arrays is used, like bulk get, bulk create
—
Reply to this email directly, view it on GitHub<#1352 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AKCSHLMW65WNNYP5EDTAKG3UVMDJXANCNFSM5JPRDNZA>.
Triage notifications on the go with GitHub Mobile for iOS<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
…--
This electronic communication and the information and any files transmitted
with it, or attached to it, are confidential and are intended solely for
the use of the individual or entity to whom it is addressed and may contain
information that is confidential, legally privileged, protected by privacy
laws, or otherwise restricted from disclosure to anyone else. If you are
not the intended recipient or the person responsible for delivering the
e-mail to the intended recipient, you are hereby notified that any use,
copying, distributing, dissemination, forwarding, printing, or copying of
this e-mail is strictly prohibited. If you received this e-mail in error,
please return the e-mail to the sender, delete it from your computer, and
destroy any printed copy of it.
|
@kcudnik Can you please approve |
Note: the build may fail due to SAI header dependency. Vendor SAI implementation shall include this PR: opencomputeproject/SAI#1352 HLD: https://github.com/sonic-net/SONiC/blob/master/doc/bulk_counter/bulk_counter.md **Why I did this?** PR https://github.com/opencomputeproject/SAI/pull/1352/files introduced new SAI APIs that supports bulk stats: sai_bulk_object_get_stats sai_bulk_object_clear_stats SONiC flex counter infrastructure shall utilize bulk stats API to gain better performance. This document discusses how to integrate these two new APIs to SONiC. **What I did?** 1. Support using bulk stats APIs based on object type. E.g. for a counter group that queries queue and pg stats, queue stats support bulk while pg stats does not, in that case queue stats shall use bulk API, pg stats shall use non bulk API 2. Automatically fall back to old way if bulk stats APIs are not supported **How I test this** Almost full unit test coverage Manual test
Note: the build may fail due to SAI header dependency. Vendor SAI implementation shall include this PR: opencomputeproject/SAI#1352 HLD: https://github.com/sonic-net/SONiC/blob/master/doc/bulk_counter/bulk_counter.md **Why I did this?** PR https://github.com/opencomputeproject/SAI/pull/1352/files introduced new SAI APIs that supports bulk stats: sai_bulk_object_get_stats sai_bulk_object_clear_stats SONiC flex counter infrastructure shall utilize bulk stats API to gain better performance. This document discusses how to integrate these two new APIs to SONiC. **What I did?** 1. Support using bulk stats APIs based on object type. E.g. for a counter group that queries queue and pg stats, queue stats support bulk while pg stats does not, in that case queue stats shall use bulk API, pg stats shall use non bulk API 2. Automatically fall back to old way if bulk stats APIs are not supported **How I test this** Almost full unit test coverage Manual test
This API introduces ability to query bulk stats for an object list.
Return counter buffer is populated in the same order as the counter id for each object in a list.
Since same counter ids are applicable to all objects in the list, objects in the object list need to be of the same type. This is consistent with other bulk APIs.