Skip to content

Commit e3a3608

Browse files
author
k9ert
committed
cleanup
1 parent d5ee4d5 commit e3a3608

File tree

1 file changed

+0
-62
lines changed

1 file changed

+0
-62
lines changed

src/stresstest/components/storage_test.py

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -134,68 +134,6 @@ def _get_storage_info(self):
134134
except Exception as e:
135135
return {"error": str(e)}
136136

137-
async def test_storage_performance(self, iterations=5, data_size=1024):
138-
"""Test storage performance with multiple operations"""
139-
results = []
140-
successful_operations = 0
141-
142-
for i in range(iterations):
143-
try:
144-
print("Storage test iteration", i + 1, "of", iterations)
145-
start_time = time.time()
146-
147-
# Create test data
148-
test_data = "x" * data_size
149-
test_file = self.test_path + "/perf_test_" + str(i) + "_" + get_timestamp() + ".txt"
150-
151-
# Write test
152-
write_start = time.time()
153-
safe_file_operation(self._write_test_file, test_file, test_data)
154-
write_time = time.time() - write_start
155-
156-
# Read test
157-
read_start = time.time()
158-
read_data = safe_file_operation(self._read_test_file, test_file)
159-
read_time = time.time() - read_start
160-
161-
# Cleanup
162-
safe_file_operation(self._delete_test_file, test_file)
163-
164-
end_time = time.time()
165-
total_duration = end_time - start_time
166-
167-
# Verify data integrity
168-
data_ok = (read_data == test_data) if read_data else False
169-
170-
results.append({
171-
"iteration": i + 1,
172-
"status": "success" if data_ok else "data_error",
173-
"data_size": data_size,
174-
"write_time": write_time,
175-
"read_time": read_time,
176-
"total_duration": total_duration,
177-
"data_integrity": data_ok
178-
})
179-
180-
if data_ok:
181-
successful_operations += 1
182-
183-
except Exception as e:
184-
results.append({
185-
"iteration": i + 1,
186-
"status": "failed",
187-
"error": str(e)
188-
})
189-
190-
return {
191-
"status": "completed",
192-
"total_iterations": iterations,
193-
"successful_operations": successful_operations,
194-
"success_rate": (successful_operations / iterations) * 100,
195-
"data_size": data_size,
196-
"results": results
197-
}
198-
199137
def is_available(self):
200138
"""Check if storage is available for testing"""
201139
return self.initial_data is not None

0 commit comments

Comments
 (0)