Skip to content

Commit

Permalink
Add query stats to canister status (#497)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamspofford-dfinity authored Nov 27, 2023
1 parent f245e7a commit e7b4cdf
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

* Added query stats to `StatusCallResult`.

## [0.31.0] - 2023-11-27

* Breaking change: Bump candid to 0.10. Downstream libraries need to bump Candid to 0.10 as well.
Expand Down
15 changes: 15 additions & 0 deletions ic-utils/src/interfaces/management_canister.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,21 @@ pub struct StatusCallResult {
/// The cycles burned by the canister in one day for its resource usage
/// (compute and memory allocation and memory usage).
pub idle_cycles_burned_per_day: Nat,
/// Additional information relating to query calls.
pub query_stats: QueryStats,
}

/// Statistics relating to query calls.
#[derive(Clone, Debug, Deserialize, CandidType)]
pub struct QueryStats {
/// The total number of query calls this canister has performed.
pub num_calls_total: Nat,
/// The total number of instructions this canister has executed during query calls.
pub num_instructions_total: Nat,
/// The total number of bytes in request payloads sent to this canister's query calls.
pub request_payload_bytes_total: Nat,
/// The total number of bytes in response payloads returned from this canister's query calls.
pub response_payload_bytes_total: Nat,
}

/// The concrete settings of a canister.
Expand Down

0 comments on commit e7b4cdf

Please sign in to comment.