Skip to content

Commit 8e3e35d

Browse files
increases batch insert size to 50000 [ch2862]
1 parent c8669d3 commit 8e3e35d

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

btrdb/stream.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
## Module Variables
3434
##########################################################################
3535

36-
INSERT_BATCH_SIZE = 5000
36+
INSERT_BATCH_SIZE = 50000
3737
MINIMUM_TIME = -(16 << 56)
3838
MAXIMUM_TIME = (48 << 56) - 1
3939

tests/btrdb/test_stream.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -727,15 +727,16 @@ def test_insert(self):
727727
"""
728728
uu = uuid.UUID('0d22a53b-e2ef-4e0a-ab89-b2d48fb2592a')
729729
endpoint = Mock(Endpoint)
730-
endpoint.insert = Mock(side_effect=[1,2])
730+
endpoint.insert = Mock(side_effect=[1,2,3])
731731
stream = Stream(btrdb=BTrDB(endpoint), uuid=uu)
732732

733-
data = list(zip(range(10000,16000), map(float, range(6000))))
733+
data = list(zip(range(10000,120000), map(float, range(110000))))
734734
version = stream.insert(data)
735735

736736
assert stream._btrdb.ep.insert.call_args_list[0][0][1] == data[:INSERT_BATCH_SIZE]
737-
assert stream._btrdb.ep.insert.call_args_list[1][0][1] == data[INSERT_BATCH_SIZE:]
738-
assert version == 2
737+
assert stream._btrdb.ep.insert.call_args_list[1][0][1] == data[INSERT_BATCH_SIZE:2*INSERT_BATCH_SIZE]
738+
assert stream._btrdb.ep.insert.call_args_list[2][0][1] == data[2*INSERT_BATCH_SIZE:]
739+
assert version == 3
739740

740741

741742
def test_nearest(self):

0 commit comments

Comments
 (0)