mirror of
https://github.com/ltcptgeneral/cs239-caching.git
synced 2025-03-30 03:35:18 +00:00
remove print statements from sieve, update gitignore, minor fix to test utils
This commit is contained in:
parent
32ac22806c
commit
839e1b8bd7
2
.gitignore
vendored
2
.gitignore
vendored
@ -7,6 +7,7 @@ __pycache__/
|
||||
|
||||
# Ignore database files (TinyDB JSON)
|
||||
database.json
|
||||
temp_DB.json
|
||||
|
||||
# Ignore environment variables file (if used)
|
||||
.env
|
||||
@ -22,4 +23,3 @@ database.json
|
||||
# Ignore MacOS system files
|
||||
.DS_Store
|
||||
|
||||
|
||||
|
6
app/cache/eviction_sieve.py
vendored
6
app/cache/eviction_sieve.py
vendored
@ -18,13 +18,13 @@ class SieveCache(Cache):
|
||||
self.hand = None
|
||||
|
||||
def print_cache_state(self):
|
||||
print("Current cache state:")
|
||||
#print("Current cache state:")
|
||||
node = self.head
|
||||
if not node:
|
||||
print("Cache is empty.")
|
||||
#print("Cache is empty.")
|
||||
return
|
||||
for _ in range(len(self.cache)):
|
||||
print(f"Key: {node.key}, Value: {node.value}, Visited: {node.visited}")
|
||||
#print(f"Key: {node.key}, Value: {node.value}, Visited: {node.visited}")
|
||||
node = node.next
|
||||
if node == self.head:
|
||||
break
|
||||
|
@ -22,5 +22,5 @@ def print_report(hits, request_times, real_time):
|
||||
print(f"average cache miss response time (ms): {miss_time / miss_count}")
|
||||
else:
|
||||
print(f"average cache miss response time (ms): N/A")
|
||||
print(f"cache throughput (requests / s) : { len(request_times) / total_time * 1000}")
|
||||
print(f"real throughput (requests / s) : { len(request_times) / (real_time)}")
|
||||
print(f"cache throughput (requests / s) : { len(request_times) / total_time * 1000}")
|
||||
print(f"real throughput (requests / s) : { len(request_times) / (real_time)}")
|
Loading…
x
Reference in New Issue
Block a user