From: Razvan Deaconescu Date: Fri, 30 Apr 2010 09:27:23 +0000 (+0300) Subject: ppf/log-parser: add timestamp support in generic parser X-Git-Tag: getopt_long~37 X-Git-Url: http://p2p-next.cs.pub.ro/gitweb/?a=commitdiff_plain;h=c1179d5b35963c87388e498fd24c2850b126fb8a;p=cs-p2p-next.git ppf/log-parser: add timestamp support in generic parser --- diff --git a/ppf/log-parser/generic/GenericStatusParser.py b/ppf/log-parser/generic/GenericStatusParser.py index 09d3cad..5077175 100644 --- a/ppf/log-parser/generic/GenericStatusParser.py +++ b/ppf/log-parser/generic/GenericStatusParser.py @@ -76,9 +76,9 @@ class GenericStatusParser: download_size = 0 upload_size = 0 eta = 0 + timestamp = datetime.datetime(2010, 04, 30) - return (num_peers, dht, download_speed, upload_speed, - download_size, upload_size, eta) + return (timestamp, num_peers, dht, download_speed, upload_speed, download_size, upload_size, eta) def parse_last_status_line(self, line): try: @@ -98,7 +98,7 @@ class GenericStatusParser: return [] return self.parse_status_line(line) - def cb_print(self, num_peers, dht, + def cb_print(self, timestamp, num_peers, dht, download_speed, upload_speed, download_size, upload_size, eta_seconds): @@ -117,7 +117,7 @@ class GenericStatusParser: if self.is_status_line(line) == False: continue - (num_peers, dht, download_speed, upload_speed, download_size, upload_size, eta_seconds) = self.parse_status_line(line) + (timestamp, num_peers, dht, download_speed, upload_speed, download_size, upload_size, eta_seconds) = self.parse_status_line(line) logging.debug("(%d, %d, %d kb/s, %d kb/s, %d bytes, %d bytes)" % (num_peers, dht, download_speed, upload_speed, download_size, upload_size))