-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update(memory metrics): store in Mbs
- Loading branch information
1 parent
b5d73c0
commit 1281ab0
Showing
3 changed files
with
6 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,11 @@ | ||
import sys | ||
|
||
def cpu_heavy_task(): | ||
# Perform a computationally heavy task | ||
result = 0 | ||
for i in range(10000000): | ||
result += i * i | ||
|
||
def memory_heavy_task(): | ||
# Allocate a large amount of memory | ||
large_list = [0] * (1024**3 // 4) # Allocate approximately 1GB of memory | ||
|
||
if __name__ == "__main__": | ||
# Run CPU-heavy tasks | ||
for _ in range(10): | ||
cpu_heavy_task() | ||
|
||
# Run Memory-heavy tasks | ||
for _ in range(10): | ||
memory_heavy_task() | ||
large_list = [0] * (1024**3 // 4) # Allocate approximately 1GB of memory | ||
|
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