From 466af438665564f256ffaf5648c55bb2afcf6a1d Mon Sep 17 00:00:00 2001 From: Stefan Kaestle Date: Wed, 10 Jan 2024 11:25:22 +0100 Subject: [PATCH 1/2] Members need to be pub, otherwise the struct is not usable --- src/ic-cdk/src/api/management_canister/main/types.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ic-cdk/src/api/management_canister/main/types.rs b/src/ic-cdk/src/api/management_canister/main/types.rs index 6bec4ddb7..455a480d7 100644 --- a/src/ic-cdk/src/api/management_canister/main/types.rs +++ b/src/ic-cdk/src/api/management_canister/main/types.rs @@ -174,10 +174,10 @@ pub struct DefiniteCanisterSettings { CandidType, Clone, Debug, Deserialize, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize, )] pub struct QueryStats { - num_calls_total: candid::Nat, - num_instructions_total: candid::Nat, - request_payload_bytes_total: candid::Nat, - response_payload_bytes_total: candid::Nat, + pub num_calls_total: candid::Nat, + pub num_instructions_total: candid::Nat, + pub request_payload_bytes_total: candid::Nat, + pub response_payload_bytes_total: candid::Nat, } /// Argument type of [canister_status](super::canister_status). From 9e870f6b72351afd5369fba23578dcb239f74788 Mon Sep 17 00:00:00 2001 From: Stefan Kaestle Date: Wed, 10 Jan 2024 14:57:34 +0100 Subject: [PATCH 2/2] Added documentation --- src/ic-cdk/src/api/management_canister/main/types.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ic-cdk/src/api/management_canister/main/types.rs b/src/ic-cdk/src/api/management_canister/main/types.rs index 455a480d7..a76547769 100644 --- a/src/ic-cdk/src/api/management_canister/main/types.rs +++ b/src/ic-cdk/src/api/management_canister/main/types.rs @@ -174,9 +174,13 @@ pub struct DefiniteCanisterSettings { CandidType, Clone, Debug, Deserialize, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize, )] pub struct QueryStats { + /// Total number of query calls. pub num_calls_total: candid::Nat, + /// Total number of instructions executed by query calls. pub num_instructions_total: candid::Nat, + /// Total number of payload bytes use for query call requests. pub request_payload_bytes_total: candid::Nat, + /// Total number of payload bytes use for query call responses. pub response_payload_bytes_total: candid::Nat, }