Skip to content

Commit

Permalink
Merge pull request avocado-framework-tests#2768 from disgoel/psutil-r…
Browse files Browse the repository at this point in the history
…eadme

fix tear down and add readme file
  • Loading branch information
PraveenPenguin authored Apr 20, 2024
2 parents 6261637 + 380ff18 commit 4f1072a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
11 changes: 5 additions & 6 deletions perf/perf_stress_ng.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,9 @@ def tearDown(self):
removes the log files and collects the dmesg data
:param: none
"""

file_name = "rm -rf /tmp/stdout /tmp/stderr /tmp/data* /tmp/stressng_output*"
try:
os.remove(file_name)
except OSError:
self.log.warn("Files do not exist")
files_to_remove = ["/tmp/stdout", "/tmp/stderr", "/tmp/data*",
"/tmp/stressng_output*"]
for file_path in files_to_remove:
if os.path.exists(file_path):
os.remove(file_path)
dmesg.collect_dmesg()
16 changes: 16 additions & 0 deletions perf/perf_stress_ng.py.data/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Description:
This test is to compare CPU load percentage from vmstat and perf
command by running stress-ng in background.
The test collects vmstat and perf record data with CPU load
10, 50 and 80 by running it for 5 iterations.

Steps followed:
Run stress-ng in background with CPU load 10, 50 and 80.
Run perf record to collect CPU load for 5 iterations.
Run vmstat to collect CPU load for 5 iterations.
Compare both results.

Pre-requisite:
1. Install psutil using pip
# pip3 install psutil
2. Install perf, gcc and stress-ng packages

0 comments on commit 4f1072a

Please sign in to comment.