Get Bulk Stats API#1352
Merged
rlhui merged 9 commits intoopencomputeproject:masterfrom Jan 15, 2022
JaiOCP:patch-2
Merged
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>
kcudnik
reviewed
Dec 6, 2021
Signed-off-by: Jai Kumar <jai.kumar@broadcom.com>
Signed-off-by: Jai Kumar <jai.kumar@broadcom.com>
rck-innovium
reviewed
Dec 9, 2021
Contributor
|
We should extend sai_query_stats_capability() to return if bulk get stats is supported for a given object type. |
Contributor
|
2 asks:
|
Signed-off-by: Jai Kumar <jai.kumar@broadcom.com>
Contributor
Author
Added the capability flags |
Contributor
Author
Taken care of both review comments |
Contributor
Author
|
@gechiang @rck-innovium @marian-pritsak @mikeberesford |
itaibaz
reviewed
Dec 10, 2021
Signed-off-by: Jai Kumar <jai.kumar@broadcom.com>
itaibaz
approved these changes
Dec 10, 2021
kcudnik
requested changes
Dec 11, 2021
kcudnik
reviewed
Dec 11, 2021
kcudnik
reviewed
Dec 11, 2021
Signed-off-by: Jai Kumar <jai.kumar@broadcom.com>
Signed-off-by: Jai Kumar <jai.kumar@broadcom.com>
Contributor
|
+1 |
rck-innovium
approved these changes
Dec 16, 2021
Contributor
Author
|
@kcudnik Please re-review |
Signed-off-by: Jai Kumar <jai.kumar@broadcom.com>
mikeberesford
approved these changes
Dec 16, 2021
kcudnik
reviewed
Jan 10, 2022
Contributor
Author
|
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.
|
Contributor
Author
|
@kcudnik Can you please approve |
kcudnik
approved these changes
Jan 13, 2022
qiluo-msft
pushed a commit
to sonic-net/sonic-sairedis
that referenced
this pull request
Aug 8, 2022
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
pettershao-ragilenetworks
pushed a commit
to pettershao-ragilenetworks/sonic-sairedis
that referenced
this pull request
Nov 18, 2022
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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.