Skip to content
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

feat: Added query stats to canister status output #3551

Merged
merged 5 commits into from
Jan 30, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/dfx/src/commands/canister/status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(" "),
Expand All @@ -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(())
}
Expand Down
Loading