Skip to content

Conversation

beniwohli
Copy link
Contributor

This allows to limit the total amount of transactions in the queue, e.g.
to limit the memory consumption with a sudden traffic spike

@beniwohli beniwohli force-pushed the feature/max-queue-length branch 2 times, most recently from 85099b6 to 5eb2f80 Compare October 2, 2017 13:39
while a higher value can increase the memory pressure of your app.
A higher value also impacts the time until transactions are indexed and searchable in Elasticsearch.

This setting is useful to limit memory consumption if you experience a sudden spike of traffic.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since there is no default value, could you add a note or link to the description of what the default value for sending events is?


def test_should_not_collect_count():
requests_store = TransactionsStore(lambda: [], collect_frequency=5, max_queue_length=5)
requests_store._transactions = 4 * [1]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you align the formatting with the above test?

requests_store = TransactionsStore(lambda: [], collect_frequency=5, max_queue_length=5)
requests_store._transactions = 6*[1]

assert requests_store.should_collect()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you also set requests_store._last_collect -= 3 to show that the count overrides the time?

@beniwohli beniwohli force-pushed the feature/max-queue-length branch from 5eb2f80 to b993f2a Compare November 15, 2017 06:39
This allows to limit the total amount of transactions in the queue, e.g.
to limit the memory consumption with a sudden traffic spike
@beniwohli beniwohli force-pushed the feature/max-queue-length branch from b993f2a to e43dbe0 Compare November 15, 2017 07:02
@beniwohli beniwohli closed this in 7cf62f0 Nov 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants