Expand dashboard analytics and document production implementation
This commit is contained in:
@@ -42,6 +42,7 @@ def seed():
|
||||
conn.execute("SET LOCAL statement_timeout=0")
|
||||
populate(conn)
|
||||
print("Seeded three games with 90 days of sample data.")
|
||||
conn.execute((DB_FILES/'seed_interactions.sql').read_text(encoding='utf-8'))
|
||||
with connect() as conn:
|
||||
conn.execute("ANALYZE")
|
||||
status()
|
||||
@@ -52,6 +53,7 @@ def reseed():
|
||||
conn.execute('SET LOCAL statement_timeout=0')
|
||||
reset_sample(conn)
|
||||
populate(conn)
|
||||
conn.execute((DB_FILES/'seed_interactions.sql').read_text(encoding='utf-8'))
|
||||
with connect() as conn:
|
||||
conn.execute('ANALYZE')
|
||||
status()
|
||||
@@ -60,7 +62,7 @@ def reseed():
|
||||
def status():
|
||||
with connect() as conn:
|
||||
counts = {}
|
||||
for table in ("games", "players", "sessions", "player_snapshots", "events", "game_metrics", "activity_runs", "products", "product_sales", "gamepasses", "gamepass_ownership"):
|
||||
for table in ("games", "players", "sessions", "player_snapshots", "events", "game_metrics", "activity_runs", "products", "product_sales", "gamepasses", "gamepass_ownership", "interaction_events"):
|
||||
counts[table] = conn.execute(sql.SQL("SELECT count(*) AS count FROM {}").format(sql.Identifier(table))).fetchone()["count"]
|
||||
print("PostgreSQL sample records: " + ", ".join(f"{k}={v:,}" for k, v in counts.items()))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user