chore: rename storage-check → storage-bench-s3-archived (S3 отключён)
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
import os
|
||||
import time
|
||||
|
||||
|
||||
def main(event, context):
|
||||
path = "/mnt/data/check.txt"
|
||||
test_data = "storage-check-ok"
|
||||
|
||||
try:
|
||||
# Write
|
||||
t0 = time.time()
|
||||
with open(path, "w") as f:
|
||||
f.write(test_data)
|
||||
write_ms = round((time.time() - t0) * 1000, 2)
|
||||
|
||||
# Read
|
||||
t0 = time.time()
|
||||
with open(path, "r") as f:
|
||||
result = f.read()
|
||||
read_ms = round((time.time() - t0) * 1000, 2)
|
||||
|
||||
# Cleanup
|
||||
os.remove(path)
|
||||
|
||||
if result == test_data:
|
||||
return {"status": "ok", "write_ms": write_ms, "read_ms": read_ms, "mount": path}
|
||||
else:
|
||||
return {"status": "error", "detail": "data mismatch"}
|
||||
|
||||
except Exception as e:
|
||||
return {"status": "error", "detail": str(e)}
|
||||
Reference in New Issue
Block a user