Add occasional basic stat reporting to InfluxDB

This commit is contained in:
Ske 2018-07-21 01:22:07 +02:00
parent ec5a023348
commit f50a08b50b
3 changed files with 37 additions and 0 deletions

View file

@ -242,6 +242,14 @@ async def member_count(conn):
async def system_count(conn):
return await conn.fetchval("select count(*) from systems")
@db_wrap
async def message_count(conn):
return await conn.fetchval("select count(*) from messages")
@db_wrap
async def account_count(conn):
return await conn.fetchval("select count(*) from accounts")
async def create_tables(conn):
await conn.execute("""create table if not exists systems (
id serial primary key,