-
Notifications
You must be signed in to change notification settings - Fork 331
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes: #2
- Loading branch information
Showing
6 changed files
with
341 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Inspiration: https://github.com/apify/crawlee/blob/master/packages/utils/src/internals/memory-info.ts | ||
|
||
from dataclasses import dataclass | ||
|
||
|
||
@dataclass | ||
class MemoryInfo: | ||
"""Describes memory usage of the process.""" | ||
|
||
total_bytes: int # Total memory available in the system or container | ||
free_bytes: int # Amount of free memory in the system or container | ||
used_bytes: int # Amount of memory used (= totalBytes - freeBytes) | ||
main_process_bytes: int # Amount of memory used by the current Python process | ||
child_processes_bytes: int # Amount of memory used by child processes of the current Python process | ||
|
||
|
||
async def get_memory_info() -> MemoryInfo: | ||
# TODO | ||
return MemoryInfo(1, 2, 3, 4, 5) |
Oops, something went wrong.