Merge lp://staging/~diogobaeder/txstatsd/fix-host-lookup into lp://staging/txstatsd
Status: | Merged |
---|---|
Approved by: | Diogo Baeder |
Approved revision: | 117 |
Merged at revision: | 103 |
Proposed branch: | lp://staging/~diogobaeder/txstatsd/fix-host-lookup |
Merge into: | lp://staging/txstatsd |
Diff against target: |
533 lines (+325/-57) 3 files modified
txstatsd/protocol.py (+109/-38) txstatsd/server/router.py (+1/-1) txstatsd/tests/test_client.py (+215/-18) |
To merge this branch: | bzr merge lp://staging/~diogobaeder/txstatsd/fix-host-lookup |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Sidnei da Silva | Approve | ||
Review via email:
|
Commit message
Sending messages to a 'queue' (a list, actually, to make it simpler) while the host is not resolved, and flushing them as soon as the host gets resolved. I didn't use Queue.Queue here because it doesn't seem that we'll have to deal with concurrency issues with this queue, since each client instance has its own queue, but if we feel the need, this can be changed later.
Description of the change
Sending messages to a 'queue' (a list, actually, to make it simpler) while the host is not resolved, and flushing them as soon as the host gets resolved. I didn't use Queue.Queue here because it doesn't seem that we'll have to deal with concurrency issues with this queue, since each client instance has its own queue, but if we feel the need, this can be changed later.
A few comments:
1. I dislike class attributes with parameters that cannot be set through the constructor. How are you suppose to change LIMIT? By subclassing? By monkey patching?
2. Along the same lines, because you can't easily change LIMIT, the tests iterate calling write() up to 'LIMIT' times, which is useless. If LIMIT was configurable, you could set it to '1' in the tests and make them more efficient.