ComputerTests 0.1.0__tar.gz → 0.1.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {computertests-0.1.0 → computertests-0.1.1}/ComputerTests.egg-info/PKG-INFO +1 -1
- {computertests-0.1.0 → computertests-0.1.1}/ComputerTests.egg-info/SOURCES.txt +1 -1
- computertests-0.1.1/ComputerTests.egg-info/top_level.txt +1 -0
- {computertests-0.1.0 → computertests-0.1.1}/PKG-INFO +1 -1
- {computertests-0.1.0 → computertests-0.1.1}/pyproject.toml +2 -2
- computertests-0.1.0/capabilities.py → computertests-0.1.1/tests.py +23 -6
- computertests-0.1.0/ComputerTests.egg-info/top_level.txt +0 -1
- {computertests-0.1.0 → computertests-0.1.1}/ComputerTests.egg-info/dependency_links.txt +0 -0
- {computertests-0.1.0 → computertests-0.1.1}/README.md +0 -0
- {computertests-0.1.0 → computertests-0.1.1}/setup.cfg +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
tests
|
|
@@ -4,9 +4,9 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "ComputerTests"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.1"
|
|
8
8
|
description = "Computer capabilities testing "
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
|
|
11
11
|
[tool.setuptools]
|
|
12
|
-
py-modules = ["
|
|
12
|
+
py-modules = ["tests"]
|
|
@@ -3,12 +3,16 @@ import time as t
|
|
|
3
3
|
|
|
4
4
|
def ram(workers: int, RAM_chunk_size: int, timeDuration: int, repeat: bool):
|
|
5
5
|
RAM_chunk_size *= 1024 * 1024
|
|
6
|
-
if workers < 0:
|
|
6
|
+
if workers < 0:
|
|
7
7
|
workers = multiprocessing.cpu_count()
|
|
8
|
+
process = []
|
|
8
9
|
for i in range(1,workers+1):
|
|
9
10
|
work = multiprocessing.Process(target = ramWorker, args = (RAM_chunk_size,repeat,timeDuration))
|
|
10
11
|
work.start()
|
|
11
|
-
|
|
12
|
+
process.append(work)
|
|
13
|
+
for p in process:
|
|
14
|
+
p.join()
|
|
15
|
+
return True, process
|
|
12
16
|
|
|
13
17
|
def ramWorker(RAM_chunk_size, repeat, time):
|
|
14
18
|
ramHog = []
|
|
@@ -30,23 +34,32 @@ def ramWorker(RAM_chunk_size, repeat, time):
|
|
|
30
34
|
# open many files
|
|
31
35
|
def files(numOfFiles: int, Name: str, size: int):
|
|
32
36
|
size *= 1024 * 1024
|
|
37
|
+
process = []
|
|
33
38
|
for i in range(1,numOfFiles+1):
|
|
34
39
|
work = multiprocessing.Process(target = openFile, args = (Name, i, size))
|
|
35
40
|
work.start()
|
|
41
|
+
process.append(work)
|
|
42
|
+
for p in process:
|
|
43
|
+
p.join()
|
|
44
|
+
return True, process
|
|
36
45
|
def openFile(name, ID, size):
|
|
37
46
|
with open(f"{name}{ID}.txt","ab") as file:
|
|
38
47
|
file.write(b"0" * size)
|
|
39
|
-
return
|
|
48
|
+
return
|
|
40
49
|
|
|
41
50
|
# open large files
|
|
42
51
|
def ssd(workers: int, chunk_size: int, name: str, timeDuration: int, repeat: bool):
|
|
43
52
|
chunk_size *= 1024 * 1024
|
|
44
53
|
if workers < 0: #negative number so optimum amount
|
|
45
54
|
workers = multiprocessing.cpu_count()
|
|
55
|
+
process = []
|
|
46
56
|
for i in range(1,workers+1):
|
|
47
57
|
work = multiprocessing.Process(target = ssdWorker, args = (i,chunk_size,name,repeat, timeDuration))
|
|
48
58
|
work.start()
|
|
49
|
-
|
|
59
|
+
process.append(work)
|
|
60
|
+
for p in process:
|
|
61
|
+
p.join()
|
|
62
|
+
return True, process
|
|
50
63
|
|
|
51
64
|
def ssdWorker(ID, size, name, repeat, time):
|
|
52
65
|
start = t.time()
|
|
@@ -71,10 +84,14 @@ def cpu(workers: int, timeDuration: int, doMath: bool):
|
|
|
71
84
|
import random as r
|
|
72
85
|
if workers < 0:
|
|
73
86
|
workers = multiprocessing.cpu_count()
|
|
87
|
+
process = []
|
|
74
88
|
for i in range(0,workers):
|
|
75
89
|
work = multiprocessing.Process(target = cpuTest, args = (timeDuration, doMath))
|
|
76
90
|
work.start()
|
|
77
|
-
|
|
91
|
+
process.append(work)
|
|
92
|
+
for p in process:
|
|
93
|
+
p.join()
|
|
94
|
+
return True, process
|
|
78
95
|
|
|
79
96
|
def cpuTest(timeDuration, doMath):
|
|
80
97
|
start = t.time()
|
|
@@ -114,7 +131,7 @@ cpu(workers, timeDuration, doMath):
|
|
|
114
131
|
Stress a CPU, spread across CPU cores.
|
|
115
132
|
|
|
116
133
|
This module uses imports: multiprocessing, time, and random.
|
|
117
|
-
Each function returns True upon succession of starting the number of workers
|
|
134
|
+
Each function returns True, process upon succession of starting the number of workers. The value is returned as a tuple.
|
|
118
135
|
Giving the functions a negative number in place of worker count, will instead be treated as the optimum amount.
|
|
119
136
|
The optimum amount is based on number of CPU cores.
|
|
120
137
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
capabilities
|
|
File without changes
|
|
File without changes
|
|
File without changes
|