MCPcopy Create free account
hub / github.com/dbcli/mycli / get_uptime

Function get_uptime

mycli/packages/special/utils.py:61–74  ·  view source on GitHub ↗
(cur: Cursor)

Source from the content-addressed store, hash-verified

59
60
61def get_uptime(cur: Cursor) -> int:
62 query = 'SHOW STATUS LIKE "Uptime"'
63 logger.debug(query)
64
65 uptime = 0
66
67 try:
68 cur.execute(query)
69 if one := cur.fetchone():
70 uptime = int(one[1] or 0)
71 except pymysql.err.OperationalError:
72 pass
73
74 return uptime
75
76
77def get_warning_count(cur: Cursor) -> int:

Calls 3

debugMethod · 0.45
executeMethod · 0.45
fetchoneMethod · 0.45