From ca1a1762e2bf4a77d792d290043286101b3a8e8a Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Tue, 4 Mar 2008 18:50:44 -0700 Subject: [PATCH] web: status: add 'started' timestamps to all operations --- src/allmydata/download.py | 3 +++ src/allmydata/interfaces.py | 6 +++++ src/allmydata/mutable.py | 6 +++++ src/allmydata/upload.py | 3 +++ src/allmydata/web/download-status.xhtml | 1 + src/allmydata/web/publish-status.xhtml | 1 + src/allmydata/web/retrieve-status.xhtml | 1 + src/allmydata/web/status.xhtml | 2 ++ src/allmydata/web/upload-status.xhtml | 1 + src/allmydata/webish.py | 32 +++++++++++++++++++++++++ 10 files changed, 56 insertions(+) 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