Ticket #1172: downloader-status-1172.dpatch

File downloader-status-1172.dpatch, 2.8 KB (added by francois, at 2010-08-31T11:08:32Z)
Line 
1Tue Aug 31 12:48:30 CEST 2010  francois@ctrlaltdel.ch
2  * DownloadStatus: show active immutable downloads in Active Operations, Fix #1172
3
4New patches:
5
6[DownloadStatus: show active immutable downloads in Active Operations, Fix #1172
7francois@ctrlaltdel.ch**20100831104830
8 Ignore-this: a7d3602dd7418304dc7f517c7e7ab7fb
9] {
10hunk ./src/allmydata/immutable/downloader/status.py 205
11 
12     def using_helper(self):
13         return False
14+
15     def get_active(self):
16hunk ./src/allmydata/immutable/downloader/status.py 207
17-        return False # TODO
18+        # a download is considered active if it has at least one outstanding
19+        # read() call
20+        for r_ev in self.read_events:
21+            (ign1, ign2, ign3, finishtime, ign4, ign5, ign6) = r_ev
22+            if finishtime is None:
23+                return True
24+        return False
25+
26     def get_started(self):
27         return self.started
28     def get_results(self):
29hunk ./src/allmydata/test/test_download.py 1261
30         e2.finished(now+5)
31         self.failUnlessEqual(ds.get_progress(), 1.0)
32 
33+    def test_active(self):
34+        now = 12345.1
35+        ds = DownloadStatus("si-1", 123)
36+        self.failUnlessEqual(ds.get_active(), False)
37+        e1 = ds.add_read_event(0, 1000, now)
38+        self.failUnlessEqual(ds.get_active(), True)
39+        e2 = ds.add_read_event(1, 1000, now+1)
40+        self.failUnlessEqual(ds.get_active(), True)
41+        e1.finished(now+2)
42+        self.failUnlessEqual(ds.get_active(), True)
43+        e2.finished(now+3)
44+        self.failUnlessEqual(ds.get_active(), False)
45+
46}
47
48Context:
49
50[_auto_deps.py: change pycrypto version requirement to avoid https://bugs.launchpad.net/pycrypto/+bug/620253
51david-sarah@jacaranda.org**20100829230038
52 Ignore-this: e58f98ef262444067fc4b31fad23e40b
53] 
54[docs: update NEWS a bit about New-Downloader
55zooko@zooko.com**20100819021446
56 Ignore-this: 31a6e2fb0a6e3d19f73481e99070da7a
57] 
58[misc: add benchmarking tool for spans
59zooko@zooko.com**20100819021420
60 Ignore-this: 569327a1908a07e5fb634526bed515b2
61] 
62[web: refactor rate computation, fixes #1166
63francois@ctrlaltdel.ch**20100815141933
64 Ignore-this: d25491858e137894142eaa67c75b0439
65] 
66[docs: doc of the download status page
67zooko@zooko.com**20100814054117
68 Ignore-this: a82ec33da3c39a7c0d47a7a6b5f81bbb
69 ref: http://tahoe-lafs.org/trac/tahoe-lafs/ticket/1169#comment:1
70] 
71[docs: NEWS: edit English usage, remove ticket numbers for regressions vs. 1.7.1 that were fixed again before 1.8.0c2
72zooko@zooko.com**20100811071758
73 Ignore-this: 993f5a1e6a9535f5b7a0bd77b93b66d0
74] 
75[docs: NEWS: more detail about new-downloader
76zooko@zooko.com**20100811071303
77 Ignore-this: 9f07da4dce9d794ce165aae287f29a1e
78] 
79[TAG allmydata-tahoe-1.8.0c2
80david-sarah@jacaranda.org**20100810073847
81 Ignore-this: c37f732b0e45f9ebfdc2f29c0899aeec
82] 
83Patch bundle hash:
84252ac131ed5597e14f7d7f385186f38d921f3a56