Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
mraszyk committed Oct 17, 2023
1 parent 18953e4 commit 8354dfe
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 17 deletions.
10 changes: 5 additions & 5 deletions spec/_attachments/ic.did
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,11 @@ service ic : {
memory_size: nat;
cycles: nat;
idle_cycles_burned_per_day: nat;
query_stats: vec record {
num_calls: nat;
num_instructions: nat;
num_request_payload_bytes: nat;
num_response_payload_bytes: nat;
query_stats: record {
num_calls_total: nat;
num_instructions_total: nat;
request_payload_bytes_total: nat;
response_payload_bytes_total: nat;
};
});
canister_info : (record {
Expand Down
27 changes: 15 additions & 12 deletions spec/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2040,13 +2040,13 @@ Indicates various information about the canister. It contains:

- Statistics regarding the query call execution of the canister, i.e., a record containing the following fields:

* `num_queries`: the total number of query calls evaluated on the canister,
* `num_calls_total`: the total number of query calls evaluated on the canister,

* `num_instructions`: the total number of WebAssembly instructions executed during the evaluation of query calls on the canister,
* `num_instructions_total`: the total number of WebAssembly instructions executed during the evaluation of query calls on the canister,

* `num_request_payload_bytes`: the total number of query call request payload (query call argument) bytes, and
* `request_payload_bytes_total`: the total number of query call request payload (query call argument) bytes, and

* `num_response_payload_bytes`: the total number of query call response payload (reply data or reject message) bytes.
* `response_payload_bytes_total`: the total number of query call response payload (reply data or reject message) bytes.

Only the controllers of the canister or the canister itself can request its status.

Expand Down Expand Up @@ -2920,9 +2920,9 @@ Finally, we can describe the state of the IC as a record having the following fi
}
QueryStats = {
timestamp : Timestamp;
num_instructions : Nat;
num_request_payload_bytes : Nat;
num_response_payload_bytes : Nat;
num_instructions_total : Nat;
request_payload_bytes_total : Nat;
response_payload_bytes_total : Nat;
}
Subnet = {
subnet_id : Principal;
Expand Down Expand Up @@ -3912,8 +3912,11 @@ S with
S.freezing_threshold[A.canister_id],
S.canister_subnet[A.canister_id].subnet_size,
);
query_stats = noise(SUM {(1, num_instructions, num_request_payload_bytes, num_response_payload_bytes) |
(t, num_instructions, num_request_payload_bytes, num_response_payload_bytes) <- S.query_stats[A.canister_id];
query_stats = noise(SUM {{num_calls_total: 1,
num_instructions_total: num_instructions_total,
request_payload_bytes_total: request_payload_bytes_total,
response_payload_bytes_total: response_payload_bytes_total} |
(t, num_instructions_total, request_payload_bytes_total, response_payload_bytes_total) <- S.query_stats[A.canister_id];
t <= S.time[A.canister_id] - T})
})
refunded_cycles = M.transferred_cycles
Expand Down Expand Up @@ -5260,9 +5263,9 @@ State after
S with
query_stats[Q.receiver] = S.query_stats[Q.receiver] · {
timestamp = S.time[Q.receiver]
num_instructions = NumInstructions
num_request_payload_bytes = |Q.Arg|
num_response_payload_bytes =
num_instructions_total = NumInstructions
request_payload_bytes_total = |Q.Arg|
response_payload_bytes_total =
if composite_query_helper(S, MAX_CYCLES_PER_QUERY, 0, Q.canister_id, Q.sender, Q.canister_id, Q.method_name, Q.arg) = (Reject (RejectCode, RejectMsg), _) then |RejectMsg|
else if composite_query_helper(S, MAX_CYCLES_PER_QUERY, 0, Q.canister_id, Q.sender, Q.canister_id, Q.method_name, Q.arg) = (Reply Res, _) then |Res|
}
Expand Down

0 comments on commit 8354dfe

Please sign in to comment.