This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
------- commit -------- | |
Times called: 69 | |
total time: 2.758 seconds | |
avg: 0.03998 | |
min: 0.00000 | |
max: 0.21891 | |
Total amount of functions calling this db function: 10 | |
Top 5 callers issuing the heaviest query: | |
(218 ms) Function _flush_database at /home/tribler/Documents/tribler/Tribler/dispersy/dispersy.py line 2089 | |
(204 ms) Function _flush_database at /home/tribler/Documents/tribler/Tribler/dispersy/dispersy.py line 2089 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
------- fetchall -------- | |
Times called: 91661 | |
total time: 278.319 seconds | |
avg: 0.00304 | |
min: 0.00000 | |
max: 0.23420 | |
Total amount of functions calling this db function: 20 | |
Top 5 callers issuing the heaviest query: | |
(234 ms) Function getRecentAndRandomTorrents at /home/tribler/Documents/tribler/Tribler/Core/CacheDB/SqliteCacheDBHandler.py line 1846 | |
(208 ms) Function getPeerIDS at /home/tribler/Documents/tribler/Tribler/Core/CacheDB/SqliteCacheDBHandler.py line 101 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from time import sleep | |
from twisted.internet import reactor | |
from twisted.internet.defer import inlineCallbacks | |
from twisted.internet.task import deferLater | |
@inlineCallbacks | |
def a(): | |
yield deferLater(reactor, 1, lambda: None) # Now the blocking function is made async, we need to yield it. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from unittest import TestCase | |
from nose.tools import raises | |
from nose.twistedtools import reactor | |
from twisted.internet.defer import inlineCallbacks | |
from twisted.internet.threads import blockingCallFromThread | |
class TestExample(TestCase): | |
@inlineCallbacks | |
@raises(RuntimeError) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
deferred(timeout=20) | |
def test_save_resume(self): | |
tdef = TorrentDef() | |
sourcefn = os.path.join(TESTS_DATA_DIR, 'video.avi') | |
tdef.add_content(sourcefn) | |
tdef.set_tracker("http://localhost/announce") | |
tdef.finalize() | |
torrentfn = os.path.join(self.session.get_state_dir(), "gen.torrent") | |
tdef.save(torrentfn) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from twisted.internet.error import ConnectingCancelledError | |
from twisted.internet.defer import Deferred, CancelledError | |
# This prints no - it doesn't work | |
d = Deferred() | |
def on_error(failure): | |
if failure.check([ConnectingCancelledError, CancelledError]): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(gdb) bt | |
#0 __GI___pthread_mutex_lock (mutex=0x7fffffff5c20) | |
at ../nptl/pthread_mutex_lock.c:66 | |
#1 0x00007fffebb020da in XrmQGetResource () | |
from /usr/lib/x86_64-linux-gnu/libX11.so.6 | |
#2 0x00007fffebadfa42 in XGetDefault () | |
from /usr/lib/x86_64-linux-gnu/libX11.so.6 | |
#3 0x00007fffeb42034f in ?? () from /usr/lib/x86_64-linux-gnu/libcairo.so.2 | |
#4 0x00007fffeb422690 in ?? () from /usr/lib/x86_64-linux-gnu/libcairo.so.2 |