Skip to content

Commit

Permalink
HOUSEKEEPING
Browse files Browse the repository at this point in the history
  • Loading branch information
joocer committed Sep 14, 2024
1 parent 8c7f4ae commit 7942fcb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
1 change: 0 additions & 1 deletion opteryx/managers/cache/memcached.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ def get(self, key: bytes) -> Union[bytes, None]:
self.skips += 1
return None
try:
print(key)
response = self._server.get(bytes(key))
self._consecutive_failures = 0
if response:
Expand Down
15 changes: 9 additions & 6 deletions tests/storage/test_cache_memcached.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,18 @@ def test_memcached_cache():
for i in range(10):
cur = conn.cursor()
time.sleep(0.01)
cur.execute("SELECT * FROM testdata.flat.ten_files;")
cur.execute("SELECT count(*) FROM testdata.flat.ten_files;")

print(f"hits: {cache.hits}, misses: {cache.misses}, skips: {cache.skips}, errors: {cache.errors}, sets: {cache.sets}")

# read the data again time, this should hit the cache
buffer = BufferPool()
buffer.reset()
cur = conn.cursor()
cur.execute("SELECT * FROM testdata.flat.ten_files;")
for i in range(10):
# read the data again time, this should hit the cache
buffer = BufferPool()
buffer.reset()

cur = conn.cursor()
cur.execute("SELECT count(*) FROM testdata.flat.ten_files;")

stats = cur.stats

print(f"hits: {cache.hits}, misses: {cache.misses}, skips: {cache.skips}, errors: {cache.errors}, sets: {cache.sets}")
Expand Down

0 comments on commit 7942fcb

Please sign in to comment.