From: Brian Warner Date: Wed, 5 Mar 2008 01:50:44 +0000 (-0700) Subject: web: status: add 'started' timestamps to all operations X-Git-Tag: allmydata-tahoe-0.9.0~69 X-Git-Url: https://git.rkrishnan.org/components/com_hotproperty/css/rgr-080307.php?a=commitdiff_plain;h=ca1a1762e2bf4a77d792d290043286101b3a8e8a;p=tahoe-lafs%2Ftahoe-lafs.git web: status: add 'started' timestamps to all operations --- diff --git a/src/allmydata/download.py b/src/allmydata/download.py index 53b268e7..66c399c5 100644 --- a/src/allmydata/download.py +++ b/src/allmydata/download.py @@ -364,7 +364,10 @@ class DownloadStatus: self.active = True self.results = None self.counter = self.statusid_counter.next() + self.started = time.time() + def get_started(self): + return self.started def get_storage_index(self): return self.storage_index def get_size(self): diff --git a/src/allmydata/interfaces.py b/src/allmydata/interfaces.py index b9ff96f4..91757856 100644 --- a/src/allmydata/interfaces.py +++ b/src/allmydata/interfaces.py @@ -1453,6 +1453,9 @@ class IClientStatus(Interface): started downloads.""" class IUploadStatus(Interface): + def get_started(): + """Return a timestamp (float with seconds since epoch) indicating + when the operation was started.""" def get_storage_index(): """Return a string with the (binary) storage index in use on this upload. Returns None if the storage index has not yet been @@ -1489,6 +1492,9 @@ class IUploadStatus(Interface): page can generate a suitable hyperlink.""" class IDownloadStatus(Interface): + def get_started(): + """Return a timestamp (float with seconds since epoch) indicating + when the operation was started.""" def get_storage_index(): """Return a string with the (binary) storage index in use on this download. This may be None if there is no storage index (i.e. LIT diff --git a/src/allmydata/mutable.py b/src/allmydata/mutable.py index 925a286a..f983d3b7 100644 --- a/src/allmydata/mutable.py +++ b/src/allmydata/mutable.py @@ -211,7 +211,10 @@ class RetrieveStatus: self.status = "Not started" self.progress = 0.0 self.counter = self.statusid_counter.next() + self.started = time.time() + def get_started(self): + return self.started def get_storage_index(self): return self.storage_index def using_helper(self): @@ -783,7 +786,10 @@ class PublishStatus: self.status = "Not started" self.progress = 0.0 self.counter = self.statusid_counter.next() + self.started = time.time() + def get_started(self): + return self.started def get_storage_index(self): return self.storage_index def using_helper(self): diff --git a/src/allmydata/upload.py b/src/allmydata/upload.py index c3dd29df..015a74a5 100644 --- a/src/allmydata/upload.py +++ b/src/allmydata/upload.py @@ -575,7 +575,10 @@ class UploadStatus: self.active = True self.results = None self.counter = self.statusid_counter.next() + self.started = time.time() + def get_started(self): + return self.started def get_storage_index(self): return self.storage_index def get_size(self): diff --git a/src/allmydata/web/download-status.xhtml b/src/allmydata/web/download-status.xhtml index 5e563acf..5a3d47e2 100644 --- a/src/allmydata/web/download-status.xhtml +++ b/src/allmydata/web/download-status.xhtml @@ -11,6 +11,7 @@

File Download Status