From 39228159a04498e0407d739335e47927eb275d8e Mon Sep 17 00:00:00 2001 From: Stefan Kaestle Date: Tue, 30 Jan 2024 11:25:06 +0100 Subject: [PATCH 1/3] Added query stats to canister status output --- src/dfx/src/commands/canister/status.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/dfx/src/commands/canister/status.rs b/src/dfx/src/commands/canister/status.rs index bfa2a4787d..c256051500 100644 --- a/src/dfx/src/commands/canister/status.rs +++ b/src/dfx/src/commands/canister/status.rs @@ -47,7 +47,7 @@ async fn canister_status( "Not Set".to_string() }; - info!(log, "Canister status call result for {}.\nStatus: {}\nControllers: {}\nMemory allocation: {}\nCompute allocation: {}\nFreezing threshold: {}\nMemory Size: {:?}\nBalance: {} Cycles\nReserved: {} Cycles\nReserved Cycles Limit: {}\nModule hash: {}", + info!(log, "Canister status call result for {}.\nStatus: {}\nControllers: {}\nMemory allocation: {}\nCompute allocation: {}\nFreezing threshold: {}\nMemory Size: {:?}\nBalance: {} Cycles\nReserved: {} Cycles\nReserved Cycles Limit: {}\nModule hash: {}\nNumber of queries: {}\nInstructions spent in queries: {}\nTotal query request paylod size (bytes): {}\nTotal query response payload size (bytes): {}", canister, status.status, controllers.join(" "), @@ -58,7 +58,11 @@ async fn canister_status( status.cycles, status.reserved_cycles, reserved_cycles_limit, - status.module_hash.map_or_else(|| "None".to_string(), |v| format!("0x{}", hex::encode(v))) + status.module_hash.map_or_else(|| "None".to_string(), |v| format!("0x{}", hex::encode(v))), + status.query_stats.num_calls_total, + status.query_stats.num_instructions_total, + status.query_stats.request_payload_bytes_total, + status.query_stats.response_payload_bytes_total, ); Ok(()) } From 125c7c0cda6f1ba9ae4c2de8aa54c539411979c2 Mon Sep 17 00:00:00 2001 From: Stefan Kaestle Date: Tue, 30 Jan 2024 11:39:22 +0100 Subject: [PATCH 2/3] Added changelog entry --- CHANGELOG.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a439c5fb4..161f8ece21 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ # UNRELEASED +### feat: query stats support + +When using `dfx canister status`, the output now includes the new query statistics. Those might initially be 0, if the feature is not yet enabled on the subnet the canister is installed in. + # 0.17.0 ### fix!: always fetch did file from canister when making canister calls @@ -1443,7 +1447,7 @@ Additionally, after build step, the `.wasm` file is archived with `gzip`. ### chore: Move all `frontend canister`-related code into the SDK repo | from (`repository` `path`) | to (path in `dfinity/sdk` repository) | summary | -|:--------------------------------------------|:-----------------------------------------------|:--------------------------------------------------------------------------------------------| +| :------------------------------------------ | :--------------------------------------------- | :------------------------------------------------------------------------------------------ | | `dfinity/cdk-rs` `/src/ic-certified-assets` | `/src/canisters/frontend/ic-certified-asset` | the core of the frontend canister | | `dfinity/certified-assets` `/` | `/src/canisters/frontend/ic-frontend-canister` | wraps `ic-certified-assets` to build the canister wasm | | `dfinity/agent-rs` `/ic-asset` | `/src/canisters/frontend/ic-asset` | library facilitating interactions with frontend canister (e.g. uploading or listing assets) | From e957b15d23707d4f2792f72d9a9aa7b3390d51b9 Mon Sep 17 00:00:00 2001 From: Stefan Kaestle Date: Tue, 30 Jan 2024 16:00:13 +0100 Subject: [PATCH 3/3] Undo format change --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 161f8ece21..d3581b19a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1447,7 +1447,7 @@ Additionally, after build step, the `.wasm` file is archived with `gzip`. ### chore: Move all `frontend canister`-related code into the SDK repo | from (`repository` `path`) | to (path in `dfinity/sdk` repository) | summary | -| :------------------------------------------ | :--------------------------------------------- | :------------------------------------------------------------------------------------------ | +|:--------------------------------------------|:-----------------------------------------------|:--------------------------------------------------------------------------------------------| | `dfinity/cdk-rs` `/src/ic-certified-assets` | `/src/canisters/frontend/ic-certified-asset` | the core of the frontend canister | | `dfinity/certified-assets` `/` | `/src/canisters/frontend/ic-frontend-canister` | wraps `ic-certified-assets` to build the canister wasm | | `dfinity/agent-rs` `/ic-asset` | `/src/canisters/frontend/ic-asset` | library facilitating interactions with frontend canister (e.g. uploading or listing assets) |