Closed komuw closed 5 years ago
Merging #74 into master will increase coverage by
0.02%
. The diff coverage is66.66%
.
@@ Coverage Diff @@
## master #74 +/- ##
==========================================
+ Coverage 79.13% 79.16% +0.02%
==========================================
Files 14 14
Lines 877 883 +6
==========================================
+ Hits 694 699 +5
- Misses 183 184 +1
Impacted Files | Coverage Δ | |
---|---|---|
wiji/__version__.py | 100% <ø> (ø) |
:arrow_up: |
cli/cli.py | 56.25% <0%> (ø) |
:arrow_up: |
cli/utils/_producer.py | 50% <33.33%> (-7.15%) |
:arrow_down: |
wiji/broker.py | 80.35% <77.77%> (+0.35%) |
:arrow_up: |
wiji/task.py | 76.07% <80%> (+0.08%) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update dbece4b...46fe850. Read the comment docs.
Thank you for contributing to wiji.
Every contribution to wiji is important.
Contributor offers to license certain software (a “Contribution” or multiple “Contributions”) to wiji, and wiji agrees to accept said Contributions, under the terms of the MIT License. Contributor understands and agrees that wiji shall have the irrevocable and perpetual right to make and distribute copies of any Contribution, as well as to create and distribute collective works and derivative works of any Contribution, under the MIT License.
Now,
What(What have you changed?)
wiji.broker.InMemoryBroker
wiji.utils.display_top_allocators
func that usestracemalloc
to dispaly the top N allocating pieces of code together with allocation statisticsWhy(Why did you change it?)
wiji.broker.InMemoryBroker
uses a dict as it's backing storage. Whenbroker.enqueue
is called, it appends an item to a dict and whenbroker.dequeue
is called, it pops an item from the dict. Sincedequeue
calls dict.pop, we would expect there not to be a memory leak since dict.pop removes that item from dict. However, if rate ofbroker.enqueue
is higher than rate ofbroker.dequeue
; then the dict will grow larger over time to no endHow
InMemoryBroker
that makes sure that the number of items inbroker.store
(the dict) for a givenqueue_name
never goes above X items. If it does, the func clears that queue back to empty.wiji.task.WatchDogTask
it's okay to empty queues in an ad hoc manner.References: