fix uptime
This commit is contained in:
parent
9c80dee9da
commit
c3484b3375
1 changed files with 2 additions and 1 deletions
|
@ -22,6 +22,7 @@ class DbTransfer(object):
|
||||||
self.user_pass = {}
|
self.user_pass = {}
|
||||||
self.port_uid_table = {}
|
self.port_uid_table = {}
|
||||||
self.onlineuser_cache = lru_cache.LRUCache(timeout=60*30)
|
self.onlineuser_cache = lru_cache.LRUCache(timeout=60*30)
|
||||||
|
self.start_time = time.time()
|
||||||
|
|
||||||
def update_all_user(self, dt_transfer):
|
def update_all_user(self, dt_transfer):
|
||||||
import cymysql
|
import cymysql
|
||||||
|
@ -362,7 +363,7 @@ class Dbv3Transfer(DbTransfer):
|
||||||
return os.popen("cat /proc/loadavg | awk '{ print $1\" \"$2\" \"$3 }'").readlines()[0]
|
return os.popen("cat /proc/loadavg | awk '{ print $1\" \"$2\" \"$3 }'").readlines()[0]
|
||||||
|
|
||||||
def uptime(self):
|
def uptime(self):
|
||||||
return time.clock()
|
return time.time() - self.start_time
|
||||||
|
|
||||||
def traffic_format(self, traffic):
|
def traffic_format(self, traffic):
|
||||||
if traffic < 1024 * 8:
|
if traffic < 1024 * 8:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue