Skip to content

Commit 6f3712b

Browse files
authored
Merge pull request #24 from sunsingerus/master
flush message
2 parents 3d87520 + 556b347 commit 6f3712b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/pool.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,16 @@ def flush_key(self, key):
6767

6868
need_flush = False
6969
now = int(time.time())
70+
flush_by = "U"
7071

7172
if len(self.pool[key][0]) >= self.max_pool_size:
7273
# events number reached
7374
need_flush = True
75+
flush_by = "SIZE"
7476
elif now >= self.flushed_at[key] + self.max_flush_interval:
7577
# time interval reached
7678
need_flush = True
79+
flush_by = "TIME"
7780

7881
if need_flush:
7982
# shift pool key list
@@ -83,7 +86,7 @@ def flush_key(self, key):
8386
while len(self.pool[key]) > 1:
8487
buckets = len(self.pool[key])
8588
last_bucket_size = len(self.pool[key][len(self.pool[key])-1])
86-
print(now, 'flushing key', key, 'backets', buckets, 'last backet size', last_bucket_size, 'keys:', len(self.pool))
89+
print(now, 'flushing key', key, 'flush by', flush_by, 'backets', buckets, 'last backet size', last_bucket_size, 'keys:', len(self.pool))
8790

8891
# time to flush data for specified key
8992
writer = self.writer_class(**self.writer_params)

0 commit comments

Comments
 (0)