Neon-tech commited on
Commit
142c48b
·
verified ·
1 Parent(s): 065be88

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -22
app.py CHANGED
@@ -1,26 +1,11 @@
1
- # bucket_test.py
2
  import os
 
3
 
4
- TEST_PATH = "/data/test_raw2.dat"
5
- CONTENT = b"hello bucket"
6
 
7
- # Write
8
- with open(TEST_PATH, "wb") as f:
9
- f.write(CONTENT)
10
- print(f"Written {len(CONTENT)} bytes to {TEST_PATH}")
11
 
12
- # Read back
13
- with open(TEST_PATH, "rb") as f:
14
- result = f.read()
15
-
16
- if result == CONTENT:
17
- print("PASS — bytes match exactly")
18
- else:
19
- print("FAIL — bytes differ")
20
- print(f"Expected: {CONTENT}")
21
- print(f"Got: {result}")
22
-
23
- # List /data
24
- print("\n/data contents:")
25
- for f in os.listdir("/data"):
26
- print(f" - {f}")
 
 
1
  import os
2
+ from pathlib import Path
3
 
4
+ total = sum(f.stat().st_size for f in Path("/data/matches").rglob("*") if f.is_file())
5
+ print(f"/data/matches: {total / 1024**3:.2f} GB")
6
 
7
+ total2 = sum(f.stat().st_size for f in Path("/data/by-language").rglob("*") if f.is_file())
8
+ print(f"/data/by-language: {total2 / 1024**3:.2f} GB")
 
 
9
 
10
+ total3 = sum(f.stat().st_size for f in Path("/data/image-shards").rglob("*") if f.is_file())
11
+ print(f"/data/image-shards: {total3 / 1024**3:.2f} GB")