mirror of
https://github.com/omg-xtao/ytdlbot.git
synced 2024-11-16 03:45:23 +00:00
metrics add refresh time
This commit is contained in:
parent
cecf98d41d
commit
f669e60e61
8
limit.py
8
limit.py
@ -103,9 +103,10 @@ class Redis:
|
||||
for key in self.r.keys("*"):
|
||||
if re.findall(r"\d+", key):
|
||||
value = self.r.get(key)
|
||||
fd.append([key, value, sizeof_fmt(int(value))])
|
||||
date = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(self.r.ttl(key) + time.time()))
|
||||
fd.append([key, value, sizeof_fmt(int(value)), date])
|
||||
fd.sort(key=lambda x: int(x[1]))
|
||||
quota_text = self.generate_table(["UserID", "bytes", "human readable"], fd)
|
||||
quota_text = self.generate_table(["UserID", "bytes", "human readable", "refresh time"], fd)
|
||||
|
||||
return self.final_text % (db_text, quota_text, metrics_text, usage_text)
|
||||
|
||||
@ -302,4 +303,5 @@ def verify_payment(user_id, unique) -> "str":
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
pass
|
||||
res = Redis().generate_file()
|
||||
print(res.getvalue().decode())
|
||||
|
Loading…
Reference in New Issue
Block a user