1
0
mirror of https://github.com/ltcptgeneral/cs239-caching.git synced 2025-04-01 12:33:25 +00:00

remove print statements from sieve, update gitignore, minor fix to test utils

This commit is contained in:
Arthur Lu 2025-03-04 06:24:13 +00:00 committed by root
parent 32ac22806c
commit 839e1b8bd7
3 changed files with 6 additions and 6 deletions

2
.gitignore vendored

@ -7,6 +7,7 @@ __pycache__/
# Ignore database files (TinyDB JSON) # Ignore database files (TinyDB JSON)
database.json database.json
temp_DB.json
# Ignore environment variables file (if used) # Ignore environment variables file (if used)
.env .env
@ -22,4 +23,3 @@ database.json
# Ignore MacOS system files # Ignore MacOS system files
.DS_Store .DS_Store

@ -18,13 +18,13 @@ class SieveCache(Cache):
self.hand = None self.hand = None
def print_cache_state(self): def print_cache_state(self):
print("Current cache state:") #print("Current cache state:")
node = self.head node = self.head
if not node: if not node:
print("Cache is empty.") #print("Cache is empty.")
return return
for _ in range(len(self.cache)): 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 node = node.next
if node == self.head: if node == self.head:
break 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}") print(f"average cache miss response time (ms): {miss_time / miss_count}")
else: else:
print(f"average cache miss response time (ms): N/A") print(f"average cache miss response time (ms): N/A")
print(f"cache throughput (requests / s) : { len(request_times) / total_time * 1000}") 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"real throughput (requests / s) : { len(request_times) / (real_time)}")