Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Provide a more efficient `ReplicatedState::message_memory_t…
…aken()` method
- Loading branch information
1 parent
17ce8f7
commit a4895b9
Showing
5 changed files
with
35 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -812,9 +812,7 @@ impl StreamHandlerImpl { | |
/// Computes the subnet's available message memory, as the difference | ||
/// between the subnet's message memory capacity and its current usage. | ||
fn subnet_available_memory(&self, state: &ReplicatedState) -> i64 { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
alin-at-dfinity
Author
Contributor
|
||
let memory_taken = state.memory_taken(); | ||
let message_memory_taken = memory_taken.messages(); | ||
self.subnet_message_memory_capacity.get() as i64 - message_memory_taken.get() as i64 | ||
self.subnet_message_memory_capacity.get() as i64 - state.message_memory_taken().get() as i64 | ||
} | ||
|
||
/// Observes "time in backlog" (since learning about their existence from | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Shouldn't this be renamed to subnet_available_message_memory to better reflect its purpose? It is functionally the same as the new method added to ExecutionEnvironment exception made for the source of subnet_message_memory_capacity.